From dc8e8d11b35d87c37ce08e3dd409e785935c39f3 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Wed, 26 Nov 2025 00:25:44 +0800 Subject: [PATCH 01/12] fix: more oas refinement --- main.ts | 214 ++++++++++++++++++++++++++++++++++++++-- specs/algod.oas3.json | 58 ++++++++--- specs/indexer.oas3.json | 3 +- specs/kmd.oas3.json | 2 +- 4 files changed, 257 insertions(+), 20 deletions(-) diff --git a/main.ts b/main.ts index 1e34968..9ac7d32 100644 --- a/main.ts +++ b/main.ts @@ -48,6 +48,18 @@ interface FilterEndpoint { methods?: string[]; // HTTP methods to apply to (default: ["get"]) } +interface FieldRename { + from: string; // Original field name + to: string; // New field name + schemaName?: string; // Optional: specific schema name to target +} + +interface CustomSchema { + name: string; // Schema name + schema: Record; // Schema definition object + linkToProperties?: string[]; // Optional: property names to update with this schema reference +} + interface ProcessingConfig { sourceUrl: string; outputPath: string; @@ -58,6 +70,7 @@ interface ProcessingConfig { fieldTransforms?: FieldTransform[]; msgpackOnlyEndpoints?: FilterEndpoint[]; jsonOnlyEndpoints?: FilterEndpoint[]; + customSchemas?: CustomSchema[]; // If true, strip APIVn prefixes from component schemas and update refs (KMD) stripKmdApiVersionPrefixes?: boolean; } @@ -216,20 +229,40 @@ function fixFieldNaming(spec: OpenAPISpec): number { let fixedCount = 0; // Properties that should be renamed for better developer experience - const fieldRenames = [ + const fieldRenames: FieldRename[] = [ { from: "application-index", to: "app_id" }, { from: "app-index", to: "app_id" }, { from: "created-application-index", to: "created_app_id" }, { from: "asset-index", to: "asset_id" }, { from: "created-asset-index", to: "created_asset_id" }, + { from: "index", to: "id", schemaName: "Asset" }, { from: "blockTxids", to: "block_tx_ids" }, ]; - const processObject = (obj: any): void => { + const processObject = (obj: any, schemaName?: string): void => { if (!obj || typeof obj !== "object") return; if (Array.isArray(obj)) { - obj.forEach((o) => processObject(o)); + obj.forEach((o) => processObject(o, schemaName)); + return; + } + + // Process schemas and track schema names + if (obj.schemas && typeof obj.schemas === "object") { + for (const [name, schemaDef] of Object.entries(obj.schemas)) { + processObject(schemaDef, name); + } + } + + // Process responses and track response names + if (obj.responses && typeof obj.responses === "object") { + for (const [name, responseDef] of Object.entries(obj.responses)) { + processObject(responseDef, name); + } + } + + // If we processed either schemas or responses, return early to avoid double processing + if ((obj.schemas && typeof obj.schemas === "object") || (obj.responses && typeof obj.responses === "object")) { return; } @@ -237,7 +270,16 @@ function fixFieldNaming(spec: OpenAPISpec): number { if (obj.properties && typeof obj.properties === "object") { for (const [propName, propDef] of Object.entries(obj.properties as Record)) { if (propDef && typeof propDef === "object") { - const rename = fieldRenames.find((r) => r.from === propName); + const rename = fieldRenames.find((r) => { + // Check if field name matches + if (r.from !== propName) return false; + + // If rename has a schema restriction, check if we're in the correct schema + if (r.schemaName && r.schemaName !== schemaName) return false; + + return true; + }); + if (rename) { propDef["x-algokit-field-rename"] = rename.to; fixedCount++; @@ -246,10 +288,10 @@ function fixFieldNaming(spec: OpenAPISpec): number { } } - // Recursively process nested objects + // Recursively process nested objects (preserve schema name context) for (const value of Object.values(obj)) { if (value && typeof value === "object") { - processObject(value); + processObject(value, schemaName); } } }; @@ -637,6 +679,70 @@ function resolveRef(spec: OpenAPISpec, ref: string): any { return current; } +/** + * Create a new custom schema and add it to the OpenAPI spec + */ +function createCustomSchema(spec: OpenAPISpec, schemaName: string, schemaDefinition: any): number { + let createdCount = 0; + + if (!spec.components) { + spec.components = {}; + } + if (!spec.components.schemas) { + spec.components.schemas = {}; + } + + // Only add if it doesn't already exist + if (!spec.components.schemas[schemaName]) { + spec.components.schemas[schemaName] = schemaDefinition; + createdCount++; + console.log(`ℹ️ Created new schema: ${schemaName}`); + } else { + console.warn(`⚠️ Schema ${schemaName} already exists, skipping creation`); + } + + return createdCount; +} + +/** + * Update property references to use a custom schema + */ +function linkSchemaToProperties(spec: OpenAPISpec, propertyName: string, schemaName: string): number { + let updatedCount = 0; + + const updatePropertyReferences = (obj: any): void => { + if (!obj || typeof obj !== "object") return; + + if (Array.isArray(obj)) { + for (const item of obj) updatePropertyReferences(item); + return; + } + + // Check if this is a properties object containing our target property + if (obj.properties && obj.properties[propertyName]) { + const property = obj.properties[propertyName]; + + // Check if it's currently using an empty object schema or inline schema + if (property.type === "object" && (!property.properties || Object.keys(property.properties).length === 0)) { + // Replace with schema reference + obj.properties[propertyName] = { + $ref: `#/components/schemas/${schemaName}`, + }; + updatedCount++; + console.log(`ℹ️ Updated ${propertyName} property to reference ${schemaName} schema`); + } + } + + // Recursively check all object values + for (const value of Object.values(obj)) { + updatePropertyReferences(value); + } + }; + + updatePropertyReferences(spec); + return updatedCount; +} + /** * Strip APIVn prefix from component schema names and update all $ref usages (KMD-specific) * Adds x-algokit-original-name and x-algokit-version metadata for traceability. @@ -896,6 +1002,26 @@ class OpenAPIProcessor { console.log(`ℹ️ Enforced json-only format for ${jsonCount} endpoint parameters/responses`); } + // 11. Create custom schemas if configured + if (this.config.customSchemas && this.config.customSchemas.length > 0) { + let customSchemaCount = 0; + let linkedPropertiesCount = 0; + for (const customSchema of this.config.customSchemas) { + customSchemaCount += createCustomSchema(spec, customSchema.name, customSchema.schema); + + // Link properties to this schema if specified + if (customSchema.linkToProperties && customSchema.linkToProperties.length > 0) { + for (const propertyName of customSchema.linkToProperties) { + linkedPropertiesCount += linkSchemaToProperties(spec, propertyName, customSchema.name); + } + } + } + console.log(`ℹ️ Created ${customSchemaCount} custom schemas`); + if (linkedPropertiesCount > 0) { + console.log(`ℹ️ Linked ${linkedPropertiesCount} properties to custom schemas`); + } + } + // Save the processed spec await SwaggerParser.validate(JSON.parse(JSON.stringify(spec))); console.log("✅ Specification is valid"); @@ -982,6 +1108,13 @@ async function processAlgodSpec() { const config: ProcessingConfig = { sourceUrl: `https://raw.githubusercontent.com/algorand/go-algorand/${stableTag}/daemon/algod/api/algod.oas2.json`, outputPath: join(process.cwd(), "specs", "algod.oas3.json"), + requiredFieldTransforms: [ + { + schemaName: "Genesis", + fieldName: "timestamp", + makeRequired: false, + }, + ], fieldTransforms: [ { fieldName: "action", @@ -1083,6 +1216,27 @@ async function processAlgodSpec() { format: "byte", }, }, + { + fieldName: "bytes", + schemaName: "AvmValue", + addItems: { + format: "byte", + }, + }, + { + fieldName: "bytes", + schemaName: "EvalDelta", + addItems: { + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + format: "byte", + }, + }, + { + fieldName: "address", + addItems: { + "x-algorand-format": "Address", + }, + }, ], vendorExtensionTransforms: [ { @@ -1150,6 +1304,40 @@ async function processAlgodSpec() { { path: "/v2/accounts/{address}", methods: ["get"] }, { path: "/v2/accounts/{address}/assets/{asset-id}", methods: ["get"] }, ], + customSchemas: [ + { + name: "SourceMap", + schema: { + type: "object", + required: ["version", "sources", "names", "mappings"], + properties: { + version: { + type: "integer", + }, + sources: { + description: 'A list of original sources used by the "mappings" entry.', + type: "array", + items: { + type: "string", + }, + }, + names: { + description: 'A list of symbol names used by the "mappings" entry.', + type: "array", + items: { + type: "string", + }, + }, + mappings: { + description: "A string with the encoded mapping data.", + type: "string", + }, + }, + description: "Source map for the program", + }, + linkToProperties: ["sourcemap"], + }, + ], }; await processAlgorandSpec(config); @@ -1182,6 +1370,13 @@ async function processKmdSpec() { targetValue: true, removeSource: false, }, + { + sourceProperty: "operationId", + sourceValue: "ListMultisg", + targetProperty: "operationId", + targetValue: "ListMultisig", + removeSource: false, + }, ], }; @@ -1267,6 +1462,13 @@ async function processIndexerSpec() { targetValue: true, removeSource: true, }, + { + sourceProperty: "x-algorand-foramt", + sourceValue: "uint64", + targetProperty: "x-algorand-format", + targetValue: "uint64", + removeSource: true, + }, ], }; diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index 629768e..987320b 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -4054,9 +4054,7 @@ "description": "base64 encoded program bytes" }, "sourcemap": { - "type": "object", - "properties": {}, - "description": "JSON of the source map" + "$ref": "#/components/schemas/SourceMap" } } } @@ -4695,8 +4693,7 @@ "id", "network", "proto", - "rwd", - "timestamp" + "rwd" ], "type": "object", "properties": { @@ -4776,7 +4773,8 @@ "properties": { "address": { "type": "string", - "description": "the account public key" + "description": "the account public key", + "x-algorand-format": "Address" }, "amount": { "type": "integer", @@ -4994,6 +4992,7 @@ "type": "integer", "description": "unique asset identifier", "x-go-type": "basics.AssetIndex", + "x-algokit-field-rename": "id", "x-algokit-bigint": true }, "params": { @@ -5316,7 +5315,8 @@ "bytes": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", - "description": "bytes value." + "description": "bytes value.", + "format": "byte" }, "uint": { "type": "integer", @@ -5360,7 +5360,8 @@ "type": "object", "properties": { "address": { - "type": "string" + "type": "string", + "x-algorand-format": "Address" }, "delta": { "$ref": "#/components/schemas/StateDelta" @@ -5398,7 +5399,9 @@ }, "bytes": { "type": "string", - "description": "\\[bs\\] bytes value." + "description": "\\[bs\\] bytes value.", + "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "format": "byte" }, "uint": { "type": "integer", @@ -6551,6 +6554,39 @@ } }, "description": "Proof of transaction in a block." + }, + "SourceMap": { + "type": "object", + "required": [ + "version", + "sources", + "names", + "mappings" + ], + "properties": { + "version": { + "type": "integer" + }, + "sources": { + "description": "A list of original sources used by the \"mappings\" entry.", + "type": "array", + "items": { + "type": "string" + } + }, + "names": { + "description": "A list of symbol names used by the \"mappings\" entry.", + "type": "array", + "items": { + "type": "string" + } + }, + "mappings": { + "description": "A string with the encoded mapping data.", + "type": "string" + } + }, + "description": "Source map for the program" } }, "responses": { @@ -7333,9 +7369,7 @@ "description": "base64 encoded program bytes" }, "sourcemap": { - "type": "object", - "properties": {}, - "description": "JSON of the source map" + "$ref": "#/components/schemas/SourceMap" } } } diff --git a/specs/indexer.oas3.json b/specs/indexer.oas3.json index 9573acc..182a5ce 100644 --- a/specs/indexer.oas3.json +++ b/specs/indexer.oas3.json @@ -3587,6 +3587,7 @@ "index": { "type": "integer", "description": "unique asset identifier", + "x-algokit-field-rename": "id", "x-algokit-bigint": true }, "deleted": { @@ -4982,7 +4983,7 @@ }, "merkle-array-index": { "type": "integer", - "x-algorand-foramt": "uint64" + "x-algorand-format": "uint64" }, "proof": { "$ref": "#/components/schemas/MerkleArrayProof" diff --git a/specs/kmd.oas3.json b/specs/kmd.oas3.json index 029b87a..5b5f85b 100644 --- a/specs/kmd.oas3.json +++ b/specs/kmd.oas3.json @@ -314,7 +314,7 @@ "post": { "summary": "List multisig accounts", "description": "Lists all of the multisig accounts whose preimages this wallet stores", - "operationId": "ListMultisg", + "operationId": "ListMultisig", "requestBody": { "content": { "application/json": { From b9e26fc8f1a31c855980f92d66051c215bbe542f Mon Sep 17 00:00:00 2001 From: Al <7698600+aorumbayev@users.noreply.github.com> Date: Fri, 28 Nov 2025 18:33:43 +0100 Subject: [PATCH 02/12] fix: oas v2 pre processing to ensure swagger converter preserves schema refs (#4) --- main.ts | 44 + specs/algod.oas3.json | 1845 +++++++++++++-------------------------- specs/indexer.oas3.json | 1673 +++++++++-------------------------- 3 files changed, 1069 insertions(+), 2493 deletions(-) diff --git a/main.ts b/main.ts index 9ac7d32..7d7f75d 100644 --- a/main.ts +++ b/main.ts @@ -75,6 +75,47 @@ interface ProcessingConfig { stripKmdApiVersionPrefixes?: boolean; } +// ===== OAS2 PRE-PROCESSING ===== + +interface OAS2Spec { + swagger?: string; + definitions?: Record; + responses?: Record; + parameters?: Record; + [key: string]: any; +} + +/** + * Pre-process OAS2 spec to move inline schemas to definitions. + * This ensures the swagger converter preserves schema $refs instead of inlining them. + */ +export function extractInlineSchemas(spec: OAS2Spec): void { + if (!spec.swagger) return; + + if (!spec.definitions) spec.definitions = {}; + + if (spec.responses) { + for (const [name, response] of Object.entries(spec.responses)) { + if (response?.schema && !response.schema.$ref) { + spec.definitions[name] = response.schema; + response.schema = { $ref: `#/definitions/${name}` }; + console.log(`ℹ️ Extracted response schema: ${name}`); + } + } + } + + if (spec.parameters) { + for (const [name, param] of Object.entries(spec.parameters as Record)) { + if (param?.schema && !param.schema.$ref) { + const schemaName = `${name}Body`; + spec.definitions[schemaName] = param.schema; + param.schema = { $ref: `#/definitions/${schemaName}` }; + console.log(`ℹ️ Extracted parameter schema: ${schemaName}`); + } + } + } +} + // ===== TRANSFORMATIONS ===== // Known missing descriptions to auto-fix @@ -925,6 +966,9 @@ class OpenAPIProcessor { // Fetch and parse the spec let spec = await this.fetchSpec(); + // Pre-process OAS2 to prevent swagger converter from inlining response schemas + extractInlineSchemas(spec as OAS2Spec); + // Convert to OpenAPI 3.0 if needed spec = await this.convertToOpenAPI3(spec); diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index 987320b..00973b4 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -389,24 +389,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "asset-holding": { - "$ref": "#/components/schemas/AssetHolding" - }, - "created-asset": { - "$ref": "#/components/schemas/AssetParams" - } - } + "$ref": "#/components/schemas/AccountAssetResponse" } } } @@ -495,28 +478,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "asset-holdings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountAssetHolding" - } - } - } + "$ref": "#/components/schemas/AccountAssetsInformationResponse" } } } @@ -613,46 +575,12 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "app-local-state": { - "$ref": "#/components/schemas/ApplicationLocalState" - }, - "created-app": { - "$ref": "#/components/schemas/ApplicationParams" - } - } + "$ref": "#/components/schemas/AccountApplicationResponse" } }, "application/msgpack": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "app-local-state": { - "$ref": "#/components/schemas/ApplicationLocalState" - }, - "created-app": { - "$ref": "#/components/schemas/ApplicationParams" - } - } + "$ref": "#/components/schemas/AccountApplicationResponse" } } } @@ -760,27 +688,7 @@ "content": { "application/msgpack": { "schema": { - "required": [ - "top-transactions", - "total-transactions" - ], - "type": "object", - "properties": { - "top-transactions": { - "type": "array", - "description": "An array of signed transaction objects.", - "items": { - "type": "object", - "properties": {}, - "x-algokit-signed-txn": true - } - }, - "total-transactions": { - "type": "integer", - "description": "Total number of transactions in the pool." - } - }, - "description": "PendingTransactions is an array of signed transactions exactly as they were submitted." + "$ref": "#/components/schemas/PendingTransactionsResponse" } } } @@ -882,24 +790,7 @@ "content": { "application/msgpack": { "schema": { - "required": [ - "block" - ], - "type": "object", - "properties": { - "block": { - "type": "object", - "properties": {}, - "description": "Block header data.", - "x-algorand-format": "BlockHeader" - }, - "cert": { - "type": "object", - "properties": {}, - "description": "Optional certificate object. This is only included when the format is set to message pack.", - "x-algorand-format": "BlockCertificate" - } - } + "$ref": "#/components/schemas/BlockResponse" } } } @@ -981,20 +872,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blockTxids" - ], - "type": "object", - "properties": { - "blockTxids": { - "type": "array", - "description": "Block transaction IDs.", - "items": { - "type": "string" - }, - "x-algokit-field-rename": "block_tx_ids" - } - } + "$ref": "#/components/schemas/BlockTxidsResponse" } } } @@ -1076,16 +954,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blockHash" - ], - "type": "object", - "properties": { - "blockHash": { - "type": "string", - "description": "Block header hash." - } - } + "$ref": "#/components/schemas/BlockHashResponse" } } } @@ -1284,18 +1153,7 @@ "content": { "application/json": { "schema": { - "required": [ - "logs" - ], - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AppCallLogs" - } - } - } + "$ref": "#/components/schemas/BlockLogsResponse" } } } @@ -1357,33 +1215,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current_round", - "online-money", - "total-money" - ], - "type": "object", - "properties": { - "current_round": { - "type": "integer", - "description": "Round", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "online-money": { - "type": "integer", - "description": "OnlineMoney", - "x-go-type": "uint64", - "x-algokit-bigint": true - }, - "total-money": { - "type": "integer", - "description": "TotalMoney", - "x-go-type": "uint64", - "x-algokit-bigint": true - } - }, - "description": "Supply represents the current supply of MicroAlgos in the system" + "$ref": "#/components/schemas/SupplyResponse" } } } @@ -1420,10 +1252,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ParticipationKey" - } + "$ref": "#/components/schemas/ParticipationKeysResponse" } } } @@ -1499,16 +1328,7 @@ "content": { "application/json": { "schema": { - "required": [ - "partId" - ], - "type": "object", - "properties": { - "partId": { - "type": "string", - "description": "encoding of the participation ID." - } - } + "$ref": "#/components/schemas/PostParticipationResponse" } } } @@ -1968,144 +1788,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-time", - "last-round", - "last-version", - "next-version", - "next-version-round", - "next-version-supported", - "stopped-at-unsupported-round", - "time-since-last-round" - ], - "type": "object", - "properties": { - "catchup-time": { - "type": "integer", - "description": "CatchupTime in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-round": { - "type": "integer", - "description": "LastRound indicates the last round seen", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "last-version": { - "type": "string", - "description": "LastVersion indicates the last consensus version supported" - }, - "next-version": { - "type": "string", - "description": "NextVersion of consensus protocol to use" - }, - "next-version-round": { - "type": "integer", - "description": "NextVersionRound is the round at which the next consensus version will apply", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "next-version-supported": { - "type": "boolean", - "description": "NextVersionSupported indicates whether the next consensus version is supported by this node" - }, - "stopped-at-unsupported-round": { - "type": "boolean", - "description": "StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress" - }, - "time-since-last-round": { - "type": "integer", - "description": "TimeSinceLastRound in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-catchpoint": { - "type": "string", - "description": "The last catchpoint seen by the node" - }, - "catchpoint": { - "type": "string", - "description": "The current catchpoint that is being caught up to" - }, - "catchpoint-total-accounts": { - "type": "integer", - "description": "The total number of accounts included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-kvs": { - "type": "integer", - "description": "The total number of key-values (KVs) included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-blocks": { - "type": "integer", - "description": "The total number of blocks that are required to complete the current catchpoint catchup", - "x-go-type": "uint64" - }, - "catchpoint-acquired-blocks": { - "type": "integer", - "description": "The number of blocks that have already been obtained by the node as part of the catchup", - "x-go-type": "uint64" - }, - "upgrade-delay": { - "type": "integer", - "description": "Upgrade delay", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-node-vote": { - "type": "boolean", - "description": "This node's upgrade vote" - }, - "upgrade-votes-required": { - "type": "integer", - "description": "Yes votes required for consensus upgrade" - }, - "upgrade-votes": { - "type": "integer", - "description": "Total votes cast for consensus upgrade" - }, - "upgrade-yes-votes": { - "type": "integer", - "description": "Yes votes cast for consensus upgrade" - }, - "upgrade-no-votes": { - "type": "integer", - "description": "No votes cast for consensus upgrade" - }, - "upgrade-next-protocol-vote-before": { - "type": "integer", - "description": "Next protocol round", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-vote-rounds": { - "type": "integer", - "description": "Total voting rounds for current upgrade" - } - }, - "description": "NodeStatus contains the information about a node status" + "$ref": "#/components/schemas/NodeStatusResponse" } } }, @@ -2168,144 +1851,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-time", - "last-round", - "last-version", - "next-version", - "next-version-round", - "next-version-supported", - "stopped-at-unsupported-round", - "time-since-last-round" - ], - "type": "object", - "properties": { - "catchup-time": { - "type": "integer", - "description": "CatchupTime in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-round": { - "type": "integer", - "description": "LastRound indicates the last round seen", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "last-version": { - "type": "string", - "description": "LastVersion indicates the last consensus version supported" - }, - "next-version": { - "type": "string", - "description": "NextVersion of consensus protocol to use" - }, - "next-version-round": { - "type": "integer", - "description": "NextVersionRound is the round at which the next consensus version will apply", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "next-version-supported": { - "type": "boolean", - "description": "NextVersionSupported indicates whether the next consensus version is supported by this node" - }, - "stopped-at-unsupported-round": { - "type": "boolean", - "description": "StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress" - }, - "time-since-last-round": { - "type": "integer", - "description": "TimeSinceLastRound in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-catchpoint": { - "type": "string", - "description": "The last catchpoint seen by the node" - }, - "catchpoint": { - "type": "string", - "description": "The current catchpoint that is being caught up to" - }, - "catchpoint-total-accounts": { - "type": "integer", - "description": "The total number of accounts included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-kvs": { - "type": "integer", - "description": "The total number of key-values (KVs) included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-blocks": { - "type": "integer", - "description": "The total number of blocks that are required to complete the current catchpoint catchup", - "x-go-type": "uint64" - }, - "catchpoint-acquired-blocks": { - "type": "integer", - "description": "The number of blocks that have already been obtained by the node as part of the catchup", - "x-go-type": "uint64" - }, - "upgrade-delay": { - "type": "integer", - "description": "Upgrade delay", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-node-vote": { - "type": "boolean", - "description": "This node's upgrade vote" - }, - "upgrade-votes-required": { - "type": "integer", - "description": "Yes votes required for consensus upgrade" - }, - "upgrade-votes": { - "type": "integer", - "description": "Total votes cast for consensus upgrade" - }, - "upgrade-yes-votes": { - "type": "integer", - "description": "Yes votes cast for consensus upgrade" - }, - "upgrade-no-votes": { - "type": "integer", - "description": "No votes cast for consensus upgrade" - }, - "upgrade-next-protocol-vote-before": { - "type": "integer", - "description": "Next protocol round", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-vote-rounds": { - "type": "integer", - "description": "Total voting rounds for current upgrade" - } - }, - "description": "NodeStatus contains the information about a node status" + "$ref": "#/components/schemas/NodeStatusResponse" } } }, @@ -2384,16 +1930,7 @@ "content": { "application/json": { "schema": { - "required": [ - "txId" - ], - "type": "object", - "properties": { - "txId": { - "type": "string", - "description": "encoding of the transaction hash." - } - } + "$ref": "#/components/schemas/PostTransactionsResponse" } } } @@ -2562,41 +2099,7 @@ "content": { "application/msgpack": { "schema": { - "required": [ - "last-round", - "txn-groups", - "version" - ], - "type": "object", - "properties": { - "version": { - "type": "integer", - "description": "The version of this response object.", - "x-go-type": "uint64" - }, - "last-round": { - "type": "integer", - "description": "The round immediately preceding this simulation. State changes through this round were used to run this simulation.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "txn-groups": { - "type": "array", - "description": "A result object for each transaction group that was simulated.", - "items": { - "$ref": "#/components/schemas/SimulateTransactionGroupResult" - } - }, - "eval-overrides": { - "$ref": "#/components/schemas/SimulationEvalOverrides" - }, - "exec-trace-config": { - "$ref": "#/components/schemas/SimulateTraceConfig" - }, - "initial-states": { - "$ref": "#/components/schemas/SimulateInitialStates" - } - } + "$ref": "#/components/schemas/SimulateResponse" } } } @@ -2663,50 +2166,7 @@ "content": { "application/json": { "schema": { - "required": [ - "consensus-version", - "fee", - "genesis-hash", - "genesis-id", - "last-round", - "min-fee" - ], - "type": "object", - "properties": { - "consensus-version": { - "type": "string", - "description": "ConsensusVersion indicates the consensus protocol version\nas of LastRound." - }, - "fee": { - "type": "integer", - "description": "Fee is the suggested transaction fee\nFee is in units of micro-Algos per byte.\nFee may fall to zero but transactions must still have a fee of\nat least MinTxnFee for the current network protocol.", - "x-go-type": "uint64", - "x-algokit-bigint": true - }, - "genesis-hash": { - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type": "string", - "description": "GenesisHash is the hash of the genesis block.", - "format": "byte" - }, - "genesis-id": { - "type": "string", - "description": "GenesisID is an ID listed in the genesis block." - }, - "last-round": { - "type": "integer", - "description": "LastRound indicates the last round seen", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "min-fee": { - "type": "integer", - "description": "The minimum transaction fee (not per byte) required for the\ntxn to validate for the current network protocol.", - "x-go-type": "uint64", - "x-algokit-bigint": true - } - }, - "description": "TransactionParams contains the parameters that help a client construct\na new transaction." + "$ref": "#/components/schemas/TransactionParametersResponse" } } } @@ -2787,27 +2247,7 @@ "content": { "application/msgpack": { "schema": { - "required": [ - "top-transactions", - "total-transactions" - ], - "type": "object", - "properties": { - "top-transactions": { - "type": "array", - "description": "An array of signed transaction objects.", - "items": { - "type": "object", - "properties": {}, - "x-algokit-signed-txn": true - } - }, - "total-transactions": { - "type": "integer", - "description": "Total number of transactions in the pool." - } - }, - "description": "PendingTransactions is an array of signed transactions exactly as they were submitted." + "$ref": "#/components/schemas/PendingTransactionsResponse" } } } @@ -3078,18 +2518,7 @@ "content": { "application/msgpack": { "schema": { - "required": [ - "Deltas" - ], - "type": "object", - "properties": { - "Deltas": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup" - } - } - } + "$ref": "#/components/schemas/TransactionGroupLedgerStateDeltasForRoundResponse" } } } @@ -3560,18 +2989,7 @@ "content": { "application/json": { "schema": { - "required": [ - "boxes" - ], - "type": "object", - "properties": { - "boxes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BoxDescriptor" - } - } - } + "$ref": "#/components/schemas/BoxesResponse" } } } @@ -3803,18 +3221,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The minimum sync round for the ledger.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/GetSyncRoundResponse" } } } @@ -4039,24 +3446,7 @@ "content": { "application/json": { "schema": { - "required": [ - "hash", - "result" - ], - "type": "object", - "properties": { - "hash": { - "type": "string", - "description": "base32 SHA512_256 of program bytes (Address style)" - }, - "result": { - "type": "string", - "description": "base64 encoded program bytes" - }, - "sourcemap": { - "$ref": "#/components/schemas/SourceMap" - } - } + "$ref": "#/components/schemas/CompileResponse" } } } @@ -4130,16 +3520,7 @@ "content": { "application/json": { "schema": { - "required": [ - "result" - ], - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "disassembled Teal code" - } - } + "$ref": "#/components/schemas/DisassembleResponse" } } } @@ -4227,17 +3608,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-message" - ], - "type": "object", - "properties": { - "catchup-message": { - "type": "string", - "description": "Catchup start response string" - } - }, - "description": "An catchpoint start response." + "$ref": "#/components/schemas/CatchpointStartResponse" } } }, @@ -4247,17 +3618,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-message" - ], - "type": "object", - "properties": { - "catchup-message": { - "type": "string", - "description": "Catchup start response string" - } - }, - "description": "An catchpoint start response." + "$ref": "#/components/schemas/CatchpointStartResponse" } } }, @@ -4337,17 +3698,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-message" - ], - "type": "object", - "properties": { - "catchup-message": { - "type": "string", - "description": "Catchup abort response string" - } - }, - "description": "An catchpoint abort response." + "$ref": "#/components/schemas/CatchpointAbortResponse" } } }, @@ -4421,27 +3772,7 @@ "content": { "application/json": { "schema": { - "required": [ - "error", - "protocol-version", - "txns" - ], - "type": "object", - "properties": { - "txns": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DryrunTxnResult" - } - }, - "error": { - "type": "string" - }, - "protocol-version": { - "type": "string", - "description": "Protocol version is the protocol version Dryrun was operated under." - } - } + "$ref": "#/components/schemas/DryrunResponse" } } } @@ -4527,17 +3858,7 @@ "content": { "application/json": { "schema": { - "required": [ - "offset" - ], - "type": "object", - "properties": { - "offset": { - "type": "integer", - "description": "Timestamp offset in seconds.", - "x-go-type": "uint64" - } - } + "$ref": "#/components/schemas/GetBlockTimeStampOffsetResponse" } } } @@ -6555,6 +5876,573 @@ }, "description": "Proof of transaction in a block." }, + "GetBlockTimeStampOffsetResponse": { + "required": [ + "offset" + ], + "type": "object", + "properties": { + "offset": { + "type": "integer", + "description": "Timestamp offset in seconds.", + "x-go-type": "uint64" + } + } + }, + "GetSyncRoundResponse": { + "required": [ + "round" + ], + "type": "object", + "properties": { + "round": { + "type": "integer", + "description": "The minimum sync round for the ledger.", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + } + } + }, + "TransactionGroupLedgerStateDeltasForRoundResponse": { + "required": [ + "Deltas" + ], + "type": "object", + "properties": { + "Deltas": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup" + } + } + } + }, + "AccountAssetResponse": { + "required": [ + "round" + ], + "type": "object", + "properties": { + "round": { + "type": "integer", + "description": "The round for which this information is relevant.", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "asset-holding": { + "$ref": "#/components/schemas/AssetHolding" + }, + "created-asset": { + "$ref": "#/components/schemas/AssetParams" + } + } + }, + "AccountAssetsInformationResponse": { + "required": [ + "round" + ], + "type": "object", + "properties": { + "round": { + "type": "integer", + "description": "The round for which this information is relevant.", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + }, + "asset-holdings": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AccountAssetHolding" + } + } + } + }, + "AccountApplicationResponse": { + "required": [ + "round" + ], + "type": "object", + "properties": { + "round": { + "type": "integer", + "description": "The round for which this information is relevant.", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "app-local-state": { + "$ref": "#/components/schemas/ApplicationLocalState" + }, + "created-app": { + "$ref": "#/components/schemas/ApplicationParams" + } + } + }, + "BlockResponse": { + "required": [ + "block" + ], + "type": "object", + "properties": { + "block": { + "type": "object", + "properties": {}, + "description": "Block header data.", + "x-algorand-format": "BlockHeader" + }, + "cert": { + "type": "object", + "properties": {}, + "description": "Optional certificate object. This is only included when the format is set to message pack.", + "x-algorand-format": "BlockCertificate" + } + } + }, + "BlockTxidsResponse": { + "required": [ + "blockTxids" + ], + "type": "object", + "properties": { + "blockTxids": { + "type": "array", + "description": "Block transaction IDs.", + "items": { + "type": "string" + }, + "x-algokit-field-rename": "block_tx_ids" + } + } + }, + "BlockHashResponse": { + "required": [ + "blockHash" + ], + "type": "object", + "properties": { + "blockHash": { + "type": "string", + "description": "Block header hash." + } + } + }, + "CatchpointStartResponse": { + "required": [ + "catchup-message" + ], + "type": "object", + "properties": { + "catchup-message": { + "type": "string", + "description": "Catchup start response string" + } + }, + "description": "An catchpoint start response." + }, + "CatchpointAbortResponse": { + "required": [ + "catchup-message" + ], + "type": "object", + "properties": { + "catchup-message": { + "type": "string", + "description": "Catchup abort response string" + } + }, + "description": "An catchpoint abort response." + }, + "NodeStatusResponse": { + "required": [ + "catchup-time", + "last-round", + "last-version", + "next-version", + "next-version-round", + "next-version-supported", + "stopped-at-unsupported-round", + "time-since-last-round" + ], + "type": "object", + "properties": { + "catchup-time": { + "type": "integer", + "description": "CatchupTime in nanoseconds", + "x-go-type": "int64", + "x-algokit-bigint": true + }, + "last-round": { + "type": "integer", + "description": "LastRound indicates the last round seen", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "last-version": { + "type": "string", + "description": "LastVersion indicates the last consensus version supported" + }, + "next-version": { + "type": "string", + "description": "NextVersion of consensus protocol to use" + }, + "next-version-round": { + "type": "integer", + "description": "NextVersionRound is the round at which the next consensus version will apply", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "next-version-supported": { + "type": "boolean", + "description": "NextVersionSupported indicates whether the next consensus version is supported by this node" + }, + "stopped-at-unsupported-round": { + "type": "boolean", + "description": "StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress" + }, + "time-since-last-round": { + "type": "integer", + "description": "TimeSinceLastRound in nanoseconds", + "x-go-type": "int64", + "x-algokit-bigint": true + }, + "last-catchpoint": { + "type": "string", + "description": "The last catchpoint seen by the node" + }, + "catchpoint": { + "type": "string", + "description": "The current catchpoint that is being caught up to" + }, + "catchpoint-total-accounts": { + "type": "integer", + "description": "The total number of accounts included in the current catchpoint", + "x-go-type": "uint64" + }, + "catchpoint-processed-accounts": { + "type": "integer", + "description": "The number of accounts from the current catchpoint that have been processed so far as part of the catchup", + "x-go-type": "uint64" + }, + "catchpoint-verified-accounts": { + "type": "integer", + "description": "The number of accounts from the current catchpoint that have been verified so far as part of the catchup", + "x-go-type": "uint64" + }, + "catchpoint-total-kvs": { + "type": "integer", + "description": "The total number of key-values (KVs) included in the current catchpoint", + "x-go-type": "uint64" + }, + "catchpoint-processed-kvs": { + "type": "integer", + "description": "The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup", + "x-go-type": "uint64" + }, + "catchpoint-verified-kvs": { + "type": "integer", + "description": "The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup", + "x-go-type": "uint64" + }, + "catchpoint-total-blocks": { + "type": "integer", + "description": "The total number of blocks that are required to complete the current catchpoint catchup", + "x-go-type": "uint64" + }, + "catchpoint-acquired-blocks": { + "type": "integer", + "description": "The number of blocks that have already been obtained by the node as part of the catchup", + "x-go-type": "uint64" + }, + "upgrade-delay": { + "type": "integer", + "description": "Upgrade delay", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "upgrade-node-vote": { + "type": "boolean", + "description": "This node's upgrade vote" + }, + "upgrade-votes-required": { + "type": "integer", + "description": "Yes votes required for consensus upgrade" + }, + "upgrade-votes": { + "type": "integer", + "description": "Total votes cast for consensus upgrade" + }, + "upgrade-yes-votes": { + "type": "integer", + "description": "Yes votes cast for consensus upgrade" + }, + "upgrade-no-votes": { + "type": "integer", + "description": "No votes cast for consensus upgrade" + }, + "upgrade-next-protocol-vote-before": { + "type": "integer", + "description": "Next protocol round", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "upgrade-vote-rounds": { + "type": "integer", + "description": "Total voting rounds for current upgrade" + } + }, + "description": "NodeStatus contains the information about a node status" + }, + "PendingTransactionsResponse": { + "required": [ + "top-transactions", + "total-transactions" + ], + "type": "object", + "properties": { + "top-transactions": { + "type": "array", + "description": "An array of signed transaction objects.", + "items": { + "type": "object", + "properties": {}, + "x-algokit-signed-txn": true + } + }, + "total-transactions": { + "type": "integer", + "description": "Total number of transactions in the pool." + } + }, + "description": "PendingTransactions is an array of signed transactions exactly as they were submitted." + }, + "ParticipationKeysResponse": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ParticipationKey" + } + }, + "PostParticipationResponse": { + "required": [ + "partId" + ], + "type": "object", + "properties": { + "partId": { + "type": "string", + "description": "encoding of the participation ID." + } + } + }, + "PostTransactionsResponse": { + "required": [ + "txId" + ], + "type": "object", + "properties": { + "txId": { + "type": "string", + "description": "encoding of the transaction hash." + } + } + }, + "SimulateResponse": { + "required": [ + "last-round", + "txn-groups", + "version" + ], + "type": "object", + "properties": { + "version": { + "type": "integer", + "description": "The version of this response object.", + "x-go-type": "uint64" + }, + "last-round": { + "type": "integer", + "description": "The round immediately preceding this simulation. State changes through this round were used to run this simulation.", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "txn-groups": { + "type": "array", + "description": "A result object for each transaction group that was simulated.", + "items": { + "$ref": "#/components/schemas/SimulateTransactionGroupResult" + } + }, + "eval-overrides": { + "$ref": "#/components/schemas/SimulationEvalOverrides" + }, + "exec-trace-config": { + "$ref": "#/components/schemas/SimulateTraceConfig" + }, + "initial-states": { + "$ref": "#/components/schemas/SimulateInitialStates" + } + } + }, + "BlockLogsResponse": { + "required": [ + "logs" + ], + "type": "object", + "properties": { + "logs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AppCallLogs" + } + } + } + }, + "SupplyResponse": { + "required": [ + "current_round", + "online-money", + "total-money" + ], + "type": "object", + "properties": { + "current_round": { + "type": "integer", + "description": "Round", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "online-money": { + "type": "integer", + "description": "OnlineMoney", + "x-go-type": "uint64", + "x-algokit-bigint": true + }, + "total-money": { + "type": "integer", + "description": "TotalMoney", + "x-go-type": "uint64", + "x-algokit-bigint": true + } + }, + "description": "Supply represents the current supply of MicroAlgos in the system" + }, + "TransactionParametersResponse": { + "required": [ + "consensus-version", + "fee", + "genesis-hash", + "genesis-id", + "last-round", + "min-fee" + ], + "type": "object", + "properties": { + "consensus-version": { + "type": "string", + "description": "ConsensusVersion indicates the consensus protocol version\nas of LastRound." + }, + "fee": { + "type": "integer", + "description": "Fee is the suggested transaction fee\nFee is in units of micro-Algos per byte.\nFee may fall to zero but transactions must still have a fee of\nat least MinTxnFee for the current network protocol.", + "x-go-type": "uint64", + "x-algokit-bigint": true + }, + "genesis-hash": { + "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type": "string", + "description": "GenesisHash is the hash of the genesis block.", + "format": "byte" + }, + "genesis-id": { + "type": "string", + "description": "GenesisID is an ID listed in the genesis block." + }, + "last-round": { + "type": "integer", + "description": "LastRound indicates the last round seen", + "x-go-type": "basics.Round", + "x-algokit-bigint": true + }, + "min-fee": { + "type": "integer", + "description": "The minimum transaction fee (not per byte) required for the\ntxn to validate for the current network protocol.", + "x-go-type": "uint64", + "x-algokit-bigint": true + } + }, + "description": "TransactionParams contains the parameters that help a client construct\na new transaction." + }, + "BoxesResponse": { + "required": [ + "boxes" + ], + "type": "object", + "properties": { + "boxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BoxDescriptor" + } + } + } + }, + "CompileResponse": { + "required": [ + "hash", + "result" + ], + "type": "object", + "properties": { + "hash": { + "type": "string", + "description": "base32 SHA512_256 of program bytes (Address style)" + }, + "result": { + "type": "string", + "description": "base64 encoded program bytes" + }, + "sourcemap": { + "$ref": "#/components/schemas/SourceMap" + } + } + }, + "DisassembleResponse": { + "required": [ + "result" + ], + "type": "object", + "properties": { + "result": { + "type": "string", + "description": "disassembled Teal code" + } + } + }, + "DryrunResponse": { + "required": [ + "error", + "protocol-version", + "txns" + ], + "type": "object", + "properties": { + "txns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DryrunTxnResult" + } + }, + "error": { + "type": "string" + }, + "protocol-version": { + "type": "string", + "description": "Protocol version is the protocol version Dryrun was operated under." + } + } + }, "SourceMap": { "type": "object", "required": [ @@ -6595,17 +6483,7 @@ "content": { "application/json": { "schema": { - "required": [ - "offset" - ], - "type": "object", - "properties": { - "offset": { - "type": "integer", - "description": "Timestamp offset in seconds.", - "x-go-type": "uint64" - } - } + "$ref": "#/components/schemas/GetBlockTimeStampOffsetResponse" } } } @@ -6615,18 +6493,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The minimum sync round for the ledger.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/GetSyncRoundResponse" } } } @@ -6646,18 +6513,7 @@ "content": { "application/json": { "schema": { - "required": [ - "Deltas" - ], - "type": "object", - "properties": { - "Deltas": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LedgerStateDeltaForTransactionGroup" - } - } - } + "$ref": "#/components/schemas/TransactionGroupLedgerStateDeltasForRoundResponse" } } } @@ -6707,24 +6563,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "asset-holding": { - "$ref": "#/components/schemas/AssetHolding" - }, - "created-asset": { - "$ref": "#/components/schemas/AssetParams" - } - } + "$ref": "#/components/schemas/AccountAssetResponse" } } } @@ -6734,28 +6573,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "asset-holdings": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AccountAssetHolding" - } - } - } + "$ref": "#/components/schemas/AccountAssetsInformationResponse" } } } @@ -6765,24 +6583,7 @@ "content": { "application/json": { "schema": { - "required": [ - "round" - ], - "type": "object", - "properties": { - "round": { - "type": "integer", - "description": "The round for which this information is relevant.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "app-local-state": { - "$ref": "#/components/schemas/ApplicationLocalState" - }, - "created-app": { - "$ref": "#/components/schemas/ApplicationParams" - } - } + "$ref": "#/components/schemas/AccountApplicationResponse" } } } @@ -6792,24 +6593,7 @@ "content": { "application/json": { "schema": { - "required": [ - "block" - ], - "type": "object", - "properties": { - "block": { - "type": "object", - "properties": {}, - "description": "Block header data.", - "x-algorand-format": "BlockHeader" - }, - "cert": { - "type": "object", - "properties": {}, - "description": "Optional certificate object. This is only included when the format is set to message pack.", - "x-algorand-format": "BlockCertificate" - } - } + "$ref": "#/components/schemas/BlockResponse" } } } @@ -6819,20 +6603,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blockTxids" - ], - "type": "object", - "properties": { - "blockTxids": { - "type": "array", - "description": "Block transaction IDs.", - "items": { - "type": "string" - }, - "x-algokit-field-rename": "block_tx_ids" - } - } + "$ref": "#/components/schemas/BlockTxidsResponse" } } } @@ -6842,16 +6613,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blockHash" - ], - "type": "object", - "properties": { - "blockHash": { - "type": "string", - "description": "Block header hash." - } - } + "$ref": "#/components/schemas/BlockHashResponse" } } } @@ -6870,17 +6632,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-message" - ], - "type": "object", - "properties": { - "catchup-message": { - "type": "string", - "description": "Catchup start response string" - } - }, - "description": "An catchpoint start response." + "$ref": "#/components/schemas/CatchpointStartResponse" } } }, @@ -6890,17 +6642,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-message" - ], - "type": "object", - "properties": { - "catchup-message": { - "type": "string", - "description": "Catchup abort response string" - } - }, - "description": "An catchpoint abort response." + "$ref": "#/components/schemas/CatchpointAbortResponse" } } }, @@ -6910,144 +6652,7 @@ "content": { "application/json": { "schema": { - "required": [ - "catchup-time", - "last-round", - "last-version", - "next-version", - "next-version-round", - "next-version-supported", - "stopped-at-unsupported-round", - "time-since-last-round" - ], - "type": "object", - "properties": { - "catchup-time": { - "type": "integer", - "description": "CatchupTime in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-round": { - "type": "integer", - "description": "LastRound indicates the last round seen", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "last-version": { - "type": "string", - "description": "LastVersion indicates the last consensus version supported" - }, - "next-version": { - "type": "string", - "description": "NextVersion of consensus protocol to use" - }, - "next-version-round": { - "type": "integer", - "description": "NextVersionRound is the round at which the next consensus version will apply", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "next-version-supported": { - "type": "boolean", - "description": "NextVersionSupported indicates whether the next consensus version is supported by this node" - }, - "stopped-at-unsupported-round": { - "type": "boolean", - "description": "StoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress" - }, - "time-since-last-round": { - "type": "integer", - "description": "TimeSinceLastRound in nanoseconds", - "x-go-type": "int64", - "x-algokit-bigint": true - }, - "last-catchpoint": { - "type": "string", - "description": "The last catchpoint seen by the node" - }, - "catchpoint": { - "type": "string", - "description": "The current catchpoint that is being caught up to" - }, - "catchpoint-total-accounts": { - "type": "integer", - "description": "The total number of accounts included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-accounts": { - "type": "integer", - "description": "The number of accounts from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-kvs": { - "type": "integer", - "description": "The total number of key-values (KVs) included in the current catchpoint", - "x-go-type": "uint64" - }, - "catchpoint-processed-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-verified-kvs": { - "type": "integer", - "description": "The number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup", - "x-go-type": "uint64" - }, - "catchpoint-total-blocks": { - "type": "integer", - "description": "The total number of blocks that are required to complete the current catchpoint catchup", - "x-go-type": "uint64" - }, - "catchpoint-acquired-blocks": { - "type": "integer", - "description": "The number of blocks that have already been obtained by the node as part of the catchup", - "x-go-type": "uint64" - }, - "upgrade-delay": { - "type": "integer", - "description": "Upgrade delay", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-node-vote": { - "type": "boolean", - "description": "This node's upgrade vote" - }, - "upgrade-votes-required": { - "type": "integer", - "description": "Yes votes required for consensus upgrade" - }, - "upgrade-votes": { - "type": "integer", - "description": "Total votes cast for consensus upgrade" - }, - "upgrade-yes-votes": { - "type": "integer", - "description": "Yes votes cast for consensus upgrade" - }, - "upgrade-no-votes": { - "type": "integer", - "description": "No votes cast for consensus upgrade" - }, - "upgrade-next-protocol-vote-before": { - "type": "integer", - "description": "Next protocol round", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "upgrade-vote-rounds": { - "type": "integer", - "description": "Total voting rounds for current upgrade" - } - }, - "description": "NodeStatus contains the information about a node status" + "$ref": "#/components/schemas/NodeStatusResponse" } } }, @@ -7058,27 +6663,7 @@ "content": { "application/json": { "schema": { - "required": [ - "top-transactions", - "total-transactions" - ], - "type": "object", - "properties": { - "top-transactions": { - "type": "array", - "description": "An array of signed transaction objects.", - "items": { - "type": "object", - "properties": {}, - "x-algokit-signed-txn": true - } - }, - "total-transactions": { - "type": "integer", - "description": "Total number of transactions in the pool." - } - }, - "description": "PendingTransactions is an array of signed transactions exactly as they were submitted." + "$ref": "#/components/schemas/PendingTransactionsResponse" } } } @@ -7088,10 +6673,7 @@ "content": { "application/json": { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ParticipationKey" - } + "$ref": "#/components/schemas/ParticipationKeysResponse" } } } @@ -7111,16 +6693,7 @@ "content": { "application/json": { "schema": { - "required": [ - "partId" - ], - "type": "object", - "properties": { - "partId": { - "type": "string", - "description": "encoding of the participation ID." - } - } + "$ref": "#/components/schemas/PostParticipationResponse" } } } @@ -7130,16 +6703,7 @@ "content": { "application/json": { "schema": { - "required": [ - "txId" - ], - "type": "object", - "properties": { - "txId": { - "type": "string", - "description": "encoding of the transaction hash." - } - } + "$ref": "#/components/schemas/PostTransactionsResponse" } } } @@ -7149,41 +6713,7 @@ "content": { "application/json": { "schema": { - "required": [ - "last-round", - "txn-groups", - "version" - ], - "type": "object", - "properties": { - "version": { - "type": "integer", - "description": "The version of this response object.", - "x-go-type": "uint64" - }, - "last-round": { - "type": "integer", - "description": "The round immediately preceding this simulation. State changes through this round were used to run this simulation.", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "txn-groups": { - "type": "array", - "description": "A result object for each transaction group that was simulated.", - "items": { - "$ref": "#/components/schemas/SimulateTransactionGroupResult" - } - }, - "eval-overrides": { - "$ref": "#/components/schemas/SimulationEvalOverrides" - }, - "exec-trace-config": { - "$ref": "#/components/schemas/SimulateTraceConfig" - }, - "initial-states": { - "$ref": "#/components/schemas/SimulateInitialStates" - } - } + "$ref": "#/components/schemas/SimulateResponse" } } } @@ -7193,18 +6723,7 @@ "content": { "application/json": { "schema": { - "required": [ - "logs" - ], - "type": "object", - "properties": { - "logs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AppCallLogs" - } - } - } + "$ref": "#/components/schemas/BlockLogsResponse" } } } @@ -7214,33 +6733,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current_round", - "online-money", - "total-money" - ], - "type": "object", - "properties": { - "current_round": { - "type": "integer", - "description": "Round", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "online-money": { - "type": "integer", - "description": "OnlineMoney", - "x-go-type": "uint64", - "x-algokit-bigint": true - }, - "total-money": { - "type": "integer", - "description": "TotalMoney", - "x-go-type": "uint64", - "x-algokit-bigint": true - } - }, - "description": "Supply represents the current supply of MicroAlgos in the system" + "$ref": "#/components/schemas/SupplyResponse" } } } @@ -7250,50 +6743,7 @@ "content": { "application/json": { "schema": { - "required": [ - "consensus-version", - "fee", - "genesis-hash", - "genesis-id", - "last-round", - "min-fee" - ], - "type": "object", - "properties": { - "consensus-version": { - "type": "string", - "description": "ConsensusVersion indicates the consensus protocol version\nas of LastRound." - }, - "fee": { - "type": "integer", - "description": "Fee is the suggested transaction fee\nFee is in units of micro-Algos per byte.\nFee may fall to zero but transactions must still have a fee of\nat least MinTxnFee for the current network protocol.", - "x-go-type": "uint64", - "x-algokit-bigint": true - }, - "genesis-hash": { - "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type": "string", - "description": "GenesisHash is the hash of the genesis block.", - "format": "byte" - }, - "genesis-id": { - "type": "string", - "description": "GenesisID is an ID listed in the genesis block." - }, - "last-round": { - "type": "integer", - "description": "LastRound indicates the last round seen", - "x-go-type": "basics.Round", - "x-algokit-bigint": true - }, - "min-fee": { - "type": "integer", - "description": "The minimum transaction fee (not per byte) required for the\ntxn to validate for the current network protocol.", - "x-go-type": "uint64", - "x-algokit-bigint": true - } - }, - "description": "TransactionParams contains the parameters that help a client construct\na new transaction." + "$ref": "#/components/schemas/TransactionParametersResponse" } } } @@ -7313,18 +6763,7 @@ "content": { "application/json": { "schema": { - "required": [ - "boxes" - ], - "type": "object", - "properties": { - "boxes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BoxDescriptor" - } - } - } + "$ref": "#/components/schemas/BoxesResponse" } } } @@ -7354,24 +6793,7 @@ "content": { "application/json": { "schema": { - "required": [ - "hash", - "result" - ], - "type": "object", - "properties": { - "hash": { - "type": "string", - "description": "base32 SHA512_256 of program bytes (Address style)" - }, - "result": { - "type": "string", - "description": "base64 encoded program bytes" - }, - "sourcemap": { - "$ref": "#/components/schemas/SourceMap" - } - } + "$ref": "#/components/schemas/CompileResponse" } } } @@ -7381,16 +6803,7 @@ "content": { "application/json": { "schema": { - "required": [ - "result" - ], - "type": "object", - "properties": { - "result": { - "type": "string", - "description": "disassembled Teal code" - } - } + "$ref": "#/components/schemas/DisassembleResponse" } } } @@ -7400,27 +6813,7 @@ "content": { "application/json": { "schema": { - "required": [ - "error", - "protocol-version", - "txns" - ], - "type": "object", - "properties": { - "txns": { - "type": "array", - "items": { - "$ref": "#/components/schemas/DryrunTxnResult" - } - }, - "error": { - "type": "string" - }, - "protocol-version": { - "type": "string", - "description": "Protocol version is the protocol version Dryrun was operated under." - } - } + "$ref": "#/components/schemas/DryrunResponse" } } } diff --git a/specs/indexer.oas3.json b/specs/indexer.oas3.json index 182a5ce..1edab55 100644 --- a/specs/indexer.oas3.json +++ b/specs/indexer.oas3.json @@ -174,28 +174,7 @@ "content": { "application/json": { "schema": { - "required": [ - "accounts", - "current-round" - ], - "type": "object", - "properties": { - "accounts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Account" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AccountsResponse" } } } @@ -205,19 +184,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -227,19 +194,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -309,21 +264,7 @@ "content": { "application/json": { "schema": { - "required": [ - "account", - "current-round" - ], - "type": "object", - "properties": { - "account": { - "$ref": "#/components/schemas/Account" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/AccountResponse" } } } @@ -333,19 +274,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -355,19 +284,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -377,19 +294,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -454,28 +359,7 @@ "content": { "application/json": { "schema": { - "required": [ - "assets", - "current-round" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AssetHolding" - } - } - } + "$ref": "#/components/schemas/AssetHoldingsResponse" } } } @@ -485,19 +369,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -507,19 +379,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -529,19 +389,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -606,28 +454,7 @@ "content": { "application/json": { "schema": { - "required": [ - "assets", - "current-round" - ], - "type": "object", - "properties": { - "assets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Asset" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AssetsResponse" } } } @@ -637,19 +464,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -659,19 +474,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -681,19 +484,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -758,28 +549,7 @@ "content": { "application/json": { "schema": { - "required": [ - "apps-local-states", - "current-round" - ], - "type": "object", - "properties": { - "apps-local-states": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationLocalState" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/ApplicationLocalStatesResponse" } } } @@ -789,19 +559,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -811,19 +569,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -833,19 +579,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -910,28 +644,7 @@ "content": { "application/json": { "schema": { - "required": [ - "applications", - "current-round" - ], - "type": "object", - "properties": { - "applications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Application" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/ApplicationsResponse" } } } @@ -941,19 +654,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -963,19 +664,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -985,19 +674,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1177,28 +854,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transactions" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - } - } + "$ref": "#/components/schemas/TransactionsResponse" } } } @@ -1208,19 +864,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1230,19 +874,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1306,28 +938,7 @@ "content": { "application/json": { "schema": { - "required": [ - "applications", - "current-round" - ], - "type": "object", - "properties": { - "applications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Application" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/ApplicationsResponse" } } } @@ -1337,19 +948,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1389,20 +988,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round" - ], - "type": "object", - "properties": { - "application": { - "$ref": "#/components/schemas/Application" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/ApplicationResponse" } } } @@ -1412,19 +998,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1434,19 +1008,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1495,28 +1057,7 @@ "content": { "application/json": { "schema": { - "required": [ - "application-id", - "boxes" - ], - "type": "object", - "properties": { - "application-id": { - "type": "integer", - "description": "\\[appidx\\] application index.", - "x-algokit-bigint": true - }, - "boxes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BoxDescriptor" - } - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/BoxesResponse" } } } @@ -1526,19 +1067,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1548,19 +1077,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1570,19 +1087,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1634,19 +1139,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1656,19 +1149,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1678,19 +1159,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1774,33 +1243,7 @@ "content": { "application/json": { "schema": { - "required": [ - "application-id", - "current-round" - ], - "type": "object", - "properties": { - "application-id": { - "type": "integer", - "description": "\\[appidx\\] application index.", - "x-algokit-bigint": true - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "log-data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationLogData" - } - } - } + "$ref": "#/components/schemas/ApplicationLogsResponse" } } } @@ -1880,28 +1323,7 @@ "content": { "application/json": { "schema": { - "required": [ - "assets", - "current-round" - ], - "type": "object", - "properties": { - "assets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Asset" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AssetsResponse" } } } @@ -1911,19 +1333,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1933,19 +1343,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -1985,21 +1383,7 @@ "content": { "application/json": { "schema": { - "required": [ - "asset", - "current-round" - ], - "type": "object", - "properties": { - "asset": { - "$ref": "#/components/schemas/Asset" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/AssetResponse" } } } @@ -2009,19 +1393,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2031,19 +1403,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2053,19 +1413,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2139,28 +1487,7 @@ "content": { "application/json": { "schema": { - "required": [ - "balances", - "current-round" - ], - "type": "object", - "properties": { - "balances": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MiniAssetHolding" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AssetBalancesResponse" } } } @@ -2170,19 +1497,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2192,19 +1507,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2406,28 +1709,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transactions" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - } - } + "$ref": "#/components/schemas/TransactionsResponse" } } } @@ -2437,19 +1719,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2459,19 +1729,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2592,28 +1850,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blocks", - "current-round" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "blocks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Block" - } - } - } + "$ref": "#/components/schemas/BlockHeadersResponse" } } } @@ -2623,19 +1860,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2645,19 +1870,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2708,19 +1921,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2730,19 +1931,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2773,21 +1962,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transaction" - ], - "type": "object", - "properties": { - "transaction": { - "$ref": "#/components/schemas/Transaction" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/TransactionResponse" } } } @@ -2797,19 +1972,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2819,19 +1982,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -2841,19 +1992,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -3074,28 +2213,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transactions" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - } - } + "$ref": "#/components/schemas/TransactionsResponse" } } } @@ -3105,19 +2223,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -3127,19 +2233,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -5081,6 +4175,333 @@ "x-algorand-format": "uint16" } } + }, + "AccountResponse": { + "required": [ + "account", + "current-round" + ], + "type": "object", + "properties": { + "account": { + "$ref": "#/components/schemas/Account" + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + } + } + }, + "AssetHoldingsResponse": { + "required": [ + "assets", + "current-round" + ], + "type": "object", + "properties": { + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AssetHolding" + } + } + } + }, + "AccountsResponse": { + "required": [ + "accounts", + "current-round" + ], + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Account" + } + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "AssetBalancesResponse": { + "required": [ + "balances", + "current-round" + ], + "type": "object", + "properties": { + "balances": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MiniAssetHolding" + } + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "ApplicationResponse": { + "required": [ + "current-round" + ], + "type": "object", + "properties": { + "application": { + "$ref": "#/components/schemas/Application" + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + } + } + }, + "ApplicationsResponse": { + "required": [ + "applications", + "current-round" + ], + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Application" + } + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "ApplicationLogsResponse": { + "required": [ + "application-id", + "current-round" + ], + "type": "object", + "properties": { + "application-id": { + "type": "integer", + "description": "\\[appidx\\] application index.", + "x-algokit-bigint": true + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + }, + "log-data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationLogData" + } + } + } + }, + "ApplicationLocalStatesResponse": { + "required": [ + "apps-local-states", + "current-round" + ], + "type": "object", + "properties": { + "apps-local-states": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ApplicationLocalState" + } + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "AssetResponse": { + "required": [ + "asset", + "current-round" + ], + "type": "object", + "properties": { + "asset": { + "$ref": "#/components/schemas/Asset" + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + } + } + }, + "BoxesResponse": { + "required": [ + "application-id", + "boxes" + ], + "type": "object", + "properties": { + "application-id": { + "type": "integer", + "description": "\\[appidx\\] application index.", + "x-algokit-bigint": true + }, + "boxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/BoxDescriptor" + } + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "ErrorResponse": { + "required": [ + "message" + ], + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": {} + }, + "message": { + "type": "string" + } + } + }, + "AssetsResponse": { + "required": [ + "assets", + "current-round" + ], + "type": "object", + "properties": { + "assets": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Asset" + } + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + } + } + }, + "BlockHeadersResponse": { + "required": [ + "blocks", + "current-round" + ], + "type": "object", + "properties": { + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + }, + "blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Block" + } + } + } + }, + "TransactionResponse": { + "required": [ + "current-round", + "transaction" + ], + "type": "object", + "properties": { + "transaction": { + "$ref": "#/components/schemas/Transaction" + }, + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + } + } + }, + "TransactionsResponse": { + "required": [ + "current-round", + "transactions" + ], + "type": "object", + "properties": { + "current-round": { + "type": "integer", + "description": "Round at which the results were computed.", + "x-algokit-bigint": true + }, + "next-token": { + "type": "string", + "description": "Used for pagination, when making another request provide this token with the next parameter." + }, + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + } + } + } } }, "responses": { @@ -5089,21 +4510,7 @@ "content": { "application/json": { "schema": { - "required": [ - "account", - "current-round" - ], - "type": "object", - "properties": { - "account": { - "$ref": "#/components/schemas/Account" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/AccountResponse" } } } @@ -5113,28 +4520,7 @@ "content": { "application/json": { "schema": { - "required": [ - "assets", - "current-round" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "assets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AssetHolding" - } - } - } + "$ref": "#/components/schemas/AssetHoldingsResponse" } } } @@ -5144,28 +4530,7 @@ "content": { "application/json": { "schema": { - "required": [ - "accounts", - "current-round" - ], - "type": "object", - "properties": { - "accounts": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Account" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AccountsResponse" } } } @@ -5175,28 +4540,7 @@ "content": { "application/json": { "schema": { - "required": [ - "balances", - "current-round" - ], - "type": "object", - "properties": { - "balances": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MiniAssetHolding" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AssetBalancesResponse" } } } @@ -5206,20 +4550,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round" - ], - "type": "object", - "properties": { - "application": { - "$ref": "#/components/schemas/Application" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/ApplicationResponse" } } } @@ -5229,28 +4560,7 @@ "content": { "application/json": { "schema": { - "required": [ - "applications", - "current-round" - ], - "type": "object", - "properties": { - "applications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Application" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/ApplicationsResponse" } } } @@ -5260,33 +4570,7 @@ "content": { "application/json": { "schema": { - "required": [ - "application-id", - "current-round" - ], - "type": "object", - "properties": { - "application-id": { - "type": "integer", - "description": "\\[appidx\\] application index.", - "x-algokit-bigint": true - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "log-data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationLogData" - } - } - } + "$ref": "#/components/schemas/ApplicationLogsResponse" } } } @@ -5296,28 +4580,7 @@ "content": { "application/json": { "schema": { - "required": [ - "apps-local-states", - "current-round" - ], - "type": "object", - "properties": { - "apps-local-states": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ApplicationLocalState" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/ApplicationLocalStatesResponse" } } } @@ -5327,21 +4590,7 @@ "content": { "application/json": { "schema": { - "required": [ - "asset", - "current-round" - ], - "type": "object", - "properties": { - "asset": { - "$ref": "#/components/schemas/Asset" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/AssetResponse" } } } @@ -5351,28 +4600,7 @@ "content": { "application/json": { "schema": { - "required": [ - "application-id", - "boxes" - ], - "type": "object", - "properties": { - "application-id": { - "type": "integer", - "description": "\\[appidx\\] application index.", - "x-algokit-bigint": true - }, - "boxes": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BoxDescriptor" - } - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/BoxesResponse" } } } @@ -5392,19 +4620,7 @@ "content": { "application/json": { "schema": { - "required": [ - "message" - ], - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": {} - }, - "message": { - "type": "string" - } - } + "$ref": "#/components/schemas/ErrorResponse" } } } @@ -5414,28 +4630,7 @@ "content": { "application/json": { "schema": { - "required": [ - "assets", - "current-round" - ], - "type": "object", - "properties": { - "assets": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Asset" - } - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - } - } + "$ref": "#/components/schemas/AssetsResponse" } } } @@ -5455,28 +4650,7 @@ "content": { "application/json": { "schema": { - "required": [ - "blocks", - "current-round" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "blocks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Block" - } - } - } + "$ref": "#/components/schemas/BlockHeadersResponse" } } } @@ -5496,21 +4670,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transaction" - ], - "type": "object", - "properties": { - "transaction": { - "$ref": "#/components/schemas/Transaction" - }, - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - } - } + "$ref": "#/components/schemas/TransactionResponse" } } } @@ -5520,28 +4680,7 @@ "content": { "application/json": { "schema": { - "required": [ - "current-round", - "transactions" - ], - "type": "object", - "properties": { - "current-round": { - "type": "integer", - "description": "Round at which the results were computed.", - "x-algokit-bigint": true - }, - "next-token": { - "type": "string", - "description": "Used for pagination, when making another request provide this token with the next parameter." - }, - "transactions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Transaction" - } - } - } + "$ref": "#/components/schemas/TransactionsResponse" } } } From 77750e963a83f34f4f0cb09879bdfcb02a24bf29 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Sat, 29 Nov 2025 21:33:53 +0800 Subject: [PATCH 03/12] chore: additional operationid naming tweaks for algosdk consistency --- main.ts | 14 ++++++++++++++ specs/algod.oas3.json | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index 7d7f75d..c5efcbf 100644 --- a/main.ts +++ b/main.ts @@ -1332,6 +1332,20 @@ async function processAlgodSpec() { targetValue: "GetBlockTxIds", removeSource: false, }, + { + sourceProperty: "operationId", + sourceValue: "SimulateTransaction", + targetProperty: "operationId", + targetValue: "SimulateTransactions", + removeSource: false, + }, + { + sourceProperty: "operationId", + sourceValue: "WaitForBlock", + targetProperty: "operationId", + targetValue: "StatusAfterBlock", + removeSource: false, + }, ], msgpackOnlyEndpoints: [ // Align with Go and JS SDKs that hardcode these to msgpack diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index 00973b4..c60a3ea 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -1829,7 +1829,7 @@ ], "summary": "Gets the node status after waiting for a round after the given round.", "description": "Waits for a block to appear after round {round} and returns the node's status at the time. There is a 1 minute timeout, when reached the current status is returned regardless of whether or not it is the round after the given round.", - "operationId": "WaitForBlock", + "operationId": "StatusAfterBlock", "parameters": [ { "name": "round", @@ -2067,7 +2067,7 @@ "nonparticipating" ], "summary": "Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round.", - "operationId": "SimulateTransaction", + "operationId": "SimulateTransactions", "parameters": [ { "name": "format", From 931f34bd33265575ef46a97c8865e69790179a8f Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 1 Dec 2025 01:32:57 +0800 Subject: [PATCH 04/12] chore: more oas tweaks --- main.ts | 14 ++++++++++++++ specs/algod.oas3.json | 42 +++++++++++++++++++++++++++-------------- specs/indexer.oas3.json | 2 +- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/main.ts b/main.ts index c5efcbf..dd74228 100644 --- a/main.ts +++ b/main.ts @@ -1346,6 +1346,13 @@ async function processAlgodSpec() { targetValue: "StatusAfterBlock", removeSource: false, }, + { + sourceProperty: "x-go-type", + sourceValue: "basics.Address", + targetProperty: "x-algorand-format", + targetValue: "Address", + removeSource: false, + }, ], msgpackOnlyEndpoints: [ // Align with Go and JS SDKs that hardcode these to msgpack @@ -1527,6 +1534,13 @@ async function processIndexerSpec() { targetValue: "uint64", removeSource: true, }, + { + sourceProperty: "operationId", + sourceValue: "lookupTransaction", + targetProperty: "operationId", + targetValue: "lookupTransactionById", + removeSource: false, + }, ], }; diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index c60a3ea..3fb2774 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -257,9 +257,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "exclude", @@ -352,9 +354,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "asset-id", @@ -449,9 +453,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "limit", @@ -538,9 +544,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "application-id", @@ -655,9 +663,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "max", @@ -1408,9 +1418,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, { "name": "dilution", @@ -6915,9 +6927,11 @@ "schema": { "pattern": "[A-Z0-9]{58}", "type": "string", - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, - "x-go-type": "basics.Address" + "x-go-type": "basics.Address", + "x-algorand-format": "Address" }, "asset-id": { "name": "asset-id", diff --git a/specs/indexer.oas3.json b/specs/indexer.oas3.json index 1edab55..2b6799d 100644 --- a/specs/indexer.oas3.json +++ b/specs/indexer.oas3.json @@ -1945,7 +1945,7 @@ "lookup" ], "description": "Lookup a single transaction.", - "operationId": "lookupTransaction", + "operationId": "lookupTransactionById", "parameters": [ { "name": "txid", From 42e6eb0bed1989060289e2e474c678c3be0081fa Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 1 Dec 2025 03:06:02 +0800 Subject: [PATCH 05/12] chore: some indexer adjustments --- main.ts | 58 +++++++++++++++++++++++++++++++++-------- specs/indexer.oas3.json | 44 ++++++++++++++++++++----------- 2 files changed, 76 insertions(+), 26 deletions(-) diff --git a/main.ts b/main.ts index dd74228..5da9bac 100644 --- a/main.ts +++ b/main.ts @@ -264,7 +264,7 @@ function transformVendorExtensions(spec: OpenAPISpec, transforms: VendorExtensio } /** - * Fix field naming - Add field rename extensions for better Rust ergonomics + * Fix field naming - Add field rename extensions for better ergonomics */ function fixFieldNaming(spec: OpenAPISpec): number { let fixedCount = 0; @@ -498,30 +498,54 @@ function transformProperties(spec: OpenAPISpec, transforms: FieldTransform[]): n return transformedCount; } - const processObject = (obj: any, currentPath: string[] = []): void => { + const processObject = (obj: any, currentPath: string[] = [], parent: any = null): void => { if (!obj || typeof obj !== "object") return; if (Array.isArray(obj)) { - obj.forEach((item, index) => processObject(item, [...currentPath, index.toString()])); + obj.forEach((item, index) => processObject(item, [...currentPath, index.toString()], obj)); return; } // Check each configured transformation for (const transform of transforms) { - const targetPath = `properties.${transform.fieldName}`; const fullPath = currentPath.join("."); - // Check if current path matches the target property path - if (fullPath.endsWith(targetPath)) { + // Handle dot-notation in fieldName (e.g., "account-id.schema" or "foreign-assets.items") + const fieldParts = transform.fieldName.split("."); + const baseName = fieldParts[0]; + + // Build possible match patterns + const targetPath = `properties.${transform.fieldName}`; + const parameterPath = `components.parameters.${transform.fieldName}`; + + // Check if current path matches the target property path or parameter path + const isPropertyMatch = fullPath.endsWith(targetPath); + const isParameterMatch = fullPath.endsWith(parameterPath); + + // Check if this is an inline parameter with matching name + let isInlineParameterMatch = false; + if (fieldParts.length === 1 && obj.name === baseName) { + // Simple case: the object itself has name="account-id" + isInlineParameterMatch = true; + } else if (fieldParts.length === 2 && parent && parent.name === baseName) { + // Nested case: parent has name="account-id" and we're at the nested property (e.g., "schema") + const lastPathPart = currentPath[currentPath.length - 1]; + if (lastPathPart === fieldParts[1]) { + isInlineParameterMatch = true; + } + } + + if (isPropertyMatch || isParameterMatch || isInlineParameterMatch) { // If schemaName is specified, check if we're in the correct schema context - if (transform.schemaName) { + // (only applies to properties, not parameters) + if (transform.schemaName && isPropertyMatch) { const schemaPath = `components.schemas.${transform.schemaName}.properties.${transform.fieldName}`; if (!fullPath.endsWith(schemaPath)) { continue; // Skip this transform if not in the specified schema } } - // Remove specified items from this property + // Remove specified items from this property/parameter if (transform.removeItems) { for (const itemToRemove of transform.removeItems) { if (obj.hasOwnProperty(itemToRemove)) { @@ -531,7 +555,7 @@ function transformProperties(spec: OpenAPISpec, transforms: FieldTransform[]): n } } - // Add specified items to this property + // Add specified items to this property/parameter if (transform.addItems) { for (const [key, value] of Object.entries(transform.addItems)) { obj[key] = value; @@ -544,7 +568,7 @@ function transformProperties(spec: OpenAPISpec, transforms: FieldTransform[]): n // Recursively process nested objects for (const [key, value] of Object.entries(obj)) { if (value && typeof value === "object") { - processObject(value, [...currentPath, key]); + processObject(value, [...currentPath, key], obj); } } }; @@ -1504,6 +1528,18 @@ async function processIndexerSpec() { "x-algokit-bigint": true, }, }, + { + fieldName: "account-id.schema", + addItems: { + "x-algorand-format": "Address", + }, + }, + { + fieldName: "account-id", + addItems: { + "x-algokit-field-rename": "account", + }, + }, ], vendorExtensionTransforms: [ { @@ -1538,7 +1574,7 @@ async function processIndexerSpec() { sourceProperty: "operationId", sourceValue: "lookupTransaction", targetProperty: "operationId", - targetValue: "lookupTransactionById", + targetValue: "lookupTransactionByID", removeSource: false, }, ], diff --git a/specs/indexer.oas3.json b/specs/indexer.oas3.json index 2b6799d..75da128 100644 --- a/specs/indexer.oas3.json +++ b/specs/indexer.oas3.json @@ -216,8 +216,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "round", @@ -316,8 +318,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "asset-id", @@ -411,8 +415,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "asset-id", @@ -506,8 +512,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "application-id", @@ -601,8 +609,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "application-id", @@ -836,8 +846,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, { "name": "rekey-to", @@ -1945,7 +1957,7 @@ "lookup" ], "description": "Lookup a single transaction.", - "operationId": "lookupTransactionById", + "operationId": "lookupTransactionByID", "parameters": [ { "name": "txid", @@ -4735,8 +4747,10 @@ "description": "account string", "required": true, "schema": { - "type": "string" - } + "type": "string", + "x-algorand-format": "Address" + }, + "x-algokit-field-rename": "account" }, "address": { "name": "address", From fd184524c928613b6913742f5ec049ec65d8c841 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Mon, 1 Dec 2025 10:14:03 +0800 Subject: [PATCH 06/12] chore: additional indexer refinements --- main.ts | 18 ++++++++++++++++++ specs/algod.oas3.json | 9 ++++++--- specs/indexer.oas3.json | 21 ++++++++++++++------- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/main.ts b/main.ts index 5da9bac..61bfa28 100644 --- a/main.ts +++ b/main.ts @@ -1305,6 +1305,18 @@ async function processAlgodSpec() { "x-algorand-format": "Address", }, }, + { + fieldName: "txid", + addItems: { + "x-algokit-field-rename": "txId", + }, + }, + { + fieldName: "tx-id", + addItems: { + "x-algokit-field-rename": "txId", + }, + }, ], vendorExtensionTransforms: [ { @@ -1540,6 +1552,12 @@ async function processIndexerSpec() { "x-algokit-field-rename": "account", }, }, + { + fieldName: "txid", + addItems: { + "x-algokit-field-rename": "txId", + }, + }, ], vendorExtensionTransforms: [ { diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index 3fb2774..d00df65 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -1047,7 +1047,8 @@ "schema": { "pattern": "[A-Z0-9]+", "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "hashtype", @@ -2319,7 +2320,8 @@ "schema": { "pattern": "[A-Z0-9]+", "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "format", @@ -6984,7 +6986,8 @@ "x-go-name": "TxID" }, "x-algorand-format": "Address", - "x-go-name": "TxID" + "x-go-name": "TxID", + "x-algokit-field-rename": "txId" }, "tx-type": { "name": "tx-type", diff --git a/specs/indexer.oas3.json b/specs/indexer.oas3.json index 75da128..698f66d 100644 --- a/specs/indexer.oas3.json +++ b/specs/indexer.oas3.json @@ -762,7 +762,8 @@ "description": "Lookup the specific transaction by ID.", "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "round", @@ -1218,7 +1219,8 @@ "description": "Lookup the specific transaction by ID.", "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "min-round", @@ -1597,7 +1599,8 @@ "description": "Lookup the specific transaction by ID.", "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "round", @@ -1965,7 +1968,8 @@ "required": true, "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" } ], "responses": { @@ -2092,7 +2096,8 @@ "description": "Lookup the specific transaction by ID.", "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, { "name": "round", @@ -2669,7 +2674,8 @@ "properties": { "txid": { "type": "string", - "description": "Transaction ID" + "description": "Transaction ID", + "x-algokit-field-rename": "txId" }, "logs": { "type": "array", @@ -5007,7 +5013,8 @@ "description": "Lookup the specific transaction by ID.", "schema": { "type": "string" - } + }, + "x-algokit-field-rename": "txId" }, "tx-type": { "name": "tx-type", From 0758bc5c987096110fdb6ea12842950cba26d456 Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Mon, 1 Dec 2025 17:31:47 +0100 Subject: [PATCH 07/12] feat: add default value for wallet_driver_name in KMD spec Add sqlite as the default value for wallet_driver_name field via fieldTransform in processKmdSpec(). This ensures generated clients default to sqlite driver when creating wallets, matching the typical Algorand node configuration. --- main.ts | 6 ++++++ specs/kmd.oas3.json | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 61bfa28..15e1aca 100644 --- a/main.ts +++ b/main.ts @@ -1462,6 +1462,12 @@ async function processKmdSpec() { "x-algokit-bytes-base64": true, }, }, + { + fieldName: "wallet_driver_name", + addItems: { + default: "sqlite", + }, + }, ], vendorExtensionTransforms: [ { diff --git a/specs/kmd.oas3.json b/specs/kmd.oas3.json index 5b5f85b..dfa6947 100644 --- a/specs/kmd.oas3.json +++ b/specs/kmd.oas3.json @@ -1218,7 +1218,8 @@ }, "wallet_driver_name": { "type": "string", - "x-go-name": "WalletDriverName" + "x-go-name": "WalletDriverName", + "default": "sqlite" }, "wallet_name": { "type": "string", From 3c036ffe83505800aabca3f2e8547d2c8a95594c Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Mon, 1 Dec 2025 17:35:13 +0100 Subject: [PATCH 08/12] chore: npm audit fix --- package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6641614..473dd3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -534,6 +534,7 @@ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -669,9 +670,9 @@ } }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { From c2c81f25caad362fd91ca8cc83d9343f43541a48 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Tue, 2 Dec 2025 01:05:58 +0800 Subject: [PATCH 09/12] chore: kmd refinements --- main.ts | 375 +++++++++++++++++++++----- specs/kmd.oas3.json | 636 +++++++++++++++++++------------------------- 2 files changed, 581 insertions(+), 430 deletions(-) diff --git a/main.ts b/main.ts index 61bfa28..3179bb4 100644 --- a/main.ts +++ b/main.ts @@ -32,7 +32,7 @@ interface VendorExtensionTransform { interface RequiredFieldTransform { schemaName: string; // e.g., "ApplicationParams" - The OpenAPI schema name - fieldName: string; // e.g., "approval-program" - The field name to transform + fieldName: string | string[]; // e.g., "approval-program" or ["approval-program", "clear-state-program"] - The field name(s) to transform makeRequired: boolean; // true = add to required array, false = remove from required array } @@ -60,6 +60,11 @@ interface CustomSchema { linkToProperties?: string[]; // Optional: property names to update with this schema reference } +interface SchemaRename { + from: string; // Original schema name + to: string; // New schema name +} + interface ProcessingConfig { sourceUrl: string; outputPath: string; @@ -71,8 +76,12 @@ interface ProcessingConfig { msgpackOnlyEndpoints?: FilterEndpoint[]; jsonOnlyEndpoints?: FilterEndpoint[]; customSchemas?: CustomSchema[]; - // If true, strip APIVn prefixes from component schemas and update refs (KMD) - stripKmdApiVersionPrefixes?: boolean; + // Schema renames to apply + schemaRenames?: SchemaRename[]; + // Property names to remove from all schemas (e.g., ["error", "message"]) + removeSchemaProperties?: string[]; + // Make all properties required in all schemas + makeAllFieldsRequired?: boolean; } // ===== OAS2 PRE-PROCESSING ===== @@ -598,33 +607,38 @@ function transformRequiredFields(spec: OpenAPISpec, requiredFieldTransforms: Req continue; } + // Normalize fieldName to an array for consistent processing + const fieldNames = Array.isArray(config.fieldName) ? config.fieldName : [config.fieldName]; + // Initialize required array if it doesn't exist and we're making a field required if (config.makeRequired && !schema.required) { schema.required = []; } - if (config.makeRequired) { - // Make field required: add to required array if not already present - if (!schema.required.includes(config.fieldName)) { - schema.required.push(config.fieldName); - transformedCount++; - console.log(`ℹ️ Made ${config.fieldName} required in ${config.schemaName}`); - } - } else { - // Make field optional: remove from required array - if (schema.required && Array.isArray(schema.required)) { - const originalLength = schema.required.length; - schema.required = schema.required.filter((field: string) => field !== config.fieldName); - - // If the required array is now empty, remove it entirely - if (schema.required.length === 0) { - delete schema.required; + for (const fieldName of fieldNames) { + if (config.makeRequired) { + // Make field required: add to required array if not already present + if (!schema.required.includes(fieldName)) { + schema.required.push(fieldName); + transformedCount++; + console.log(`ℹ️ Made ${fieldName} required in ${config.schemaName}`); } + } else { + // Make field optional: remove from required array + if (schema.required && Array.isArray(schema.required)) { + const originalLength = schema.required.length; + schema.required = schema.required.filter((field: string) => field !== fieldName); + + // If the required array is now empty, remove it entirely + if (schema.required.length === 0) { + delete schema.required; + } - const removedCount = originalLength - (schema.required?.length || 0); - if (removedCount > 0) { - transformedCount += removedCount; - console.log(`ℹ️ Made ${config.fieldName} optional in ${config.schemaName}`); + const removedCount = originalLength - (schema.required?.length || 0); + if (removedCount > 0) { + transformedCount += removedCount; + console.log(`ℹ️ Made ${fieldName} optional in ${config.schemaName}`); + } } } } @@ -809,55 +823,44 @@ function linkSchemaToProperties(spec: OpenAPISpec, propertyName: string, schemaN } /** - * Strip APIVn prefix from component schema names and update all $ref usages (KMD-specific) - * Adds x-algokit-original-name and x-algokit-version metadata for traceability. + * Rename component schemas and update all $ref usages according to configuration. + * Adds x-algokit-original-name metadata for traceability. */ -function stripKmdApiVersionPrefixes(spec: OpenAPISpec): { - renamed: number; - collisions: number; -} { +function renameSchemas(spec: OpenAPISpec, renames: SchemaRename[]): number { let renamed = 0; - let collisions = 0; const components = spec.components; - if (!components || !components.schemas) { - return { renamed, collisions }; + if (!components || !components.schemas || !renames?.length) { + return renamed; } const schemas = components.schemas as Record; const oldToNewName: Record = {}; const newSchemas: Record = {}; - const versionPrefix = /^APIV(\d+)(.+)$/; // e.g., APIV1DELETEMultisigResponse + // Build rename map from configuration + const renameMap = new Map(renames.map((r) => [r.from, r])); // 1) Build rename map and new schemas object for (const [name, schema] of Object.entries(schemas)) { - const match = name.match(versionPrefix); - if (!match) { - if (newSchemas[name]) { - collisions++; - newSchemas[`${name}__DUP`] = schema; - } else { - newSchemas[name] = schema; - } - continue; - } + const renameConfig = renameMap.get(name); - const version = Number(match[1]); - const base = match[2]; // e.g., DELETEMultisigResponse - let target = base; - - // Avoid collisions: if target already exists, suffix with V - if (newSchemas[target] || Object.values(oldToNewName).includes(target)) { - target = `${base}V${version}`; - collisions++; + if (!renameConfig) { + // No rename configured, keep as-is + newSchemas[name] = schema; + continue; } - // Record mapping and add metadata (in case in future new versions of the spec are added) + const target = renameConfig.to; oldToNewName[name] = target; const schemaCopy = { ...(schema as any) }; schemaCopy["x-algokit-original-name"] = name; - schemaCopy["x-algokit-kmd-api-version"] = version; + + // Update description + if (schemaCopy.description && typeof schemaCopy.description === "string") { + schemaCopy.description = schemaCopy.description.replace(new RegExp(name, "g"), target).replace(/\nfriendly:.+$/, ""); + } + newSchemas[target] = schemaCopy; renamed++; } @@ -866,7 +869,7 @@ function stripKmdApiVersionPrefixes(spec: OpenAPISpec): { components.schemas = newSchemas as any; if (renamed === 0) { - return { renamed, collisions }; + return renamed; } // 2) Update all $ref occurrences pointing to old schema names @@ -890,7 +893,179 @@ function stripKmdApiVersionPrefixes(spec: OpenAPISpec): { updateRefs(spec); - return { renamed, collisions }; + return renamed; +} + +/** + * Remove specified properties from all schemas in the spec + */ +function removeSchemaProperties(spec: OpenAPISpec, propertiesToRemove: string[]): number { + let removedCount = 0; + + if (!spec.components?.schemas || !propertiesToRemove || propertiesToRemove.length === 0) { + return removedCount; + } + + const schemas = spec.components.schemas as Record; + + for (const [schemaName, schema] of Object.entries(schemas)) { + if (!schema || typeof schema !== "object" || !schema.properties) { + continue; + } + + for (const propertyName of propertiesToRemove) { + if (schema.properties.hasOwnProperty(propertyName)) { + delete schema.properties[propertyName]; + removedCount++; + console.log(`ℹ️ Removed property '${propertyName}' from schema '${schemaName}'`); + } + } + } + + return removedCount; +} + +/** + * Make all properties required in all schemas + */ +function makeAllFieldsRequired(spec: OpenAPISpec): number { + let modifiedCount = 0; + + if (!spec.components?.schemas) { + return modifiedCount; + } + + const schemas = spec.components.schemas as Record; + + for (const [schemaName, schema] of Object.entries(schemas)) { + if (!schema || typeof schema !== "object" || !schema.properties) { + continue; + } + + const propertyNames = Object.keys(schema.properties); + + if (propertyNames.length === 0) { + continue; + } + + // Initialize required array if it doesn't exist + if (!schema.required) { + schema.required = []; + } + + // Add all properties to required array if not already present + let addedCount = 0; + for (const propertyName of propertyNames) { + if (!schema.required.includes(propertyName)) { + schema.required.push(propertyName); + addedCount++; + } + } + + if (addedCount > 0) { + modifiedCount += addedCount; + console.log(`ℹ️ Made ${addedCount} field(s) required in schema '${schemaName}'`); + } + } + + return modifiedCount; +} + +/** + * Remove schemas that have no properties and update all references to them + */ +function removeEmptySchemas(spec: OpenAPISpec): { removedSchemas: number; updatedReferences: number } { + let removedSchemas = 0; + let updatedReferences = 0; + + if (!spec.components?.schemas) { + return { removedSchemas, updatedReferences }; + } + + const schemas = spec.components.schemas as Record; + const emptySchemasToRemove: string[] = []; + + // Find schemas with empty properties + for (const [schemaName, schema] of Object.entries(schemas)) { + if ( + schema && + typeof schema === "object" && + schema.properties && + typeof schema.properties === "object" && + Object.keys(schema.properties).length === 0 + ) { + emptySchemasToRemove.push(schemaName); + console.log(`ℹ️ Found empty schema: ${schemaName}`); + } + } + + if (emptySchemasToRemove.length === 0) { + return { removedSchemas, updatedReferences }; + } + + // Function to recursively find and replace schema references + const replaceSchemaReferences = (obj: any, parent: any = null, parentKey: string = ""): void => { + if (!obj || typeof obj !== "object") return; + + if (Array.isArray(obj)) { + obj.forEach((item, index) => replaceSchemaReferences(item, obj, index.toString())); + return; + } + + // Check if this is a "content" object that contains a reference to an empty schema + if (parentKey === "content" && obj && typeof obj === "object") { + // Check each media type in the content object + for (const [mediaType, mediaTypeObj] of Object.entries(obj)) { + if ( + mediaTypeObj && + typeof mediaTypeObj === "object" && + (mediaTypeObj as any).schema && + typeof (mediaTypeObj as any).schema === "object" + ) { + const schema = (mediaTypeObj as any).schema; + if (schema.$ref && typeof schema.$ref === "string") { + const refMatch = schema.$ref.match(/^#\/components\/schemas\/(.+)$/); + if (refMatch && emptySchemasToRemove.includes(refMatch[1])) { + // This references an empty schema, replace the entire content object with {} + if (parent && parent[parentKey]) { + parent[parentKey] = {}; + updatedReferences++; + console.log(`ℹ️ Replaced content object referencing empty schema '${refMatch[1]}' with {}`); + return; // Don't process further since we replaced the whole content object + } + } + } + } + } + } + + // Recursively process nested objects + for (const [key, value] of Object.entries(obj)) { + if (value && typeof value === "object") { + replaceSchemaReferences(value, obj, key); + } + } + }; + + // Process all paths to find and replace references + if (spec.paths) { + replaceSchemaReferences(spec.paths); + } + + // Process all components to find and replace references (except schemas themselves) + if (spec.components) { + const { schemas: _, ...otherComponents } = spec.components; + replaceSchemaReferences(otherComponents); + } + + // Remove the empty schemas + for (const schemaName of emptySchemasToRemove) { + delete schemas[schemaName]; + removedSchemas++; + console.log(`ℹ️ Removed empty schema: ${schemaName}`); + } + + return { removedSchemas, updatedReferences }; } // ===== MAIN PROCESSOR ===== @@ -1001,49 +1176,67 @@ class OpenAPIProcessor { // Apply transformations console.log("ℹ️ Applying transformations..."); - // 0. KMD-only: strip APIVn prefixes before other transforms if requested - if (this.config.stripKmdApiVersionPrefixes) { - const { renamed, collisions } = stripKmdApiVersionPrefixes(spec); + // Rename schemas if configured (e.g., strip APIVn prefixes from KMD) + if (this.config.schemaRenames && this.config.schemaRenames.length > 0) { + const renamed = renameSchemas(spec, this.config.schemaRenames); if (renamed > 0) { - console.log(`ℹ️ Stripped APIVn prefix from ${renamed} schemas (collisions resolved: ${collisions})`); + console.log(`ℹ️ Renamed ${renamed} schemas`); + } + } + + // Remove specified schema properties if configured (KMD error/message cleanup) + if (this.config.removeSchemaProperties && this.config.removeSchemaProperties.length > 0) { + const removedCount = removeSchemaProperties(spec, this.config.removeSchemaProperties); + console.log(`ℹ️ Removed ${removedCount} properties from schemas`); + + // After removing properties, check for and remove schemas that now have no properties + const { removedSchemas, updatedReferences } = removeEmptySchemas(spec); + if (removedSchemas > 0) { + console.log(`ℹ️ Removed ${removedSchemas} empty schemas and updated ${updatedReferences} references`); } } - // 1. Fix missing descriptions + // Fix missing descriptions const descriptionCount = fixMissingDescriptions(spec); console.log(`ℹ️ Fixed ${descriptionCount} missing descriptions`); - // 2. Fix pydantic recursion error + // Fix pydantic recursion error const pydanticCount = fixPydanticRecursionError(spec); console.log(`ℹ️ Fixed ${pydanticCount} pydantic recursion errors`); - // 3. Fix field naming + // Fix field naming const fieldNamingCount = fixFieldNaming(spec); console.log(`ℹ️ Added field rename extensions to ${fieldNamingCount} properties`); - // 4. Fix TealValue bytes fields + // Fix TealValue bytes fields const tealValueCount = fixTealValueBytes(spec); console.log(`ℹ️ Added bytes base64 extensions to ${tealValueCount} TealValue.bytes properties`); - // 5. Fix bigint properties + // Fix bigint properties const bigIntCount = fixBigInt(spec); console.log(`ℹ️ Added x-algokit-bigint to ${bigIntCount} properties`); - // 6. Transform required fields if configured + // Make all fields required if configured + if (this.config.makeAllFieldsRequired) { + const madeRequiredCount = makeAllFieldsRequired(spec); + console.log(`ℹ️ Made ${madeRequiredCount} fields required across all schemas`); + } + + // Transform required fields if configured let transformedFieldsCount = 0; if (this.config.requiredFieldTransforms && this.config.requiredFieldTransforms.length > 0) { transformedFieldsCount = transformRequiredFields(spec, this.config.requiredFieldTransforms); console.log(`ℹ️ Transformed ${transformedFieldsCount} required field states`); } - // 7. Transform properties if configured + // Transform properties if configured let transformedPropertiesCount = 0; if (this.config.fieldTransforms && this.config.fieldTransforms.length > 0) { transformedPropertiesCount = transformProperties(spec, this.config.fieldTransforms); console.log(`ℹ️ Applied ${transformedPropertiesCount} property transformations (additions/removals)`); } - // 8. Transform vendor extensions if configured + // Transform vendor extensions if configured if (this.config.vendorExtensionTransforms && this.config.vendorExtensionTransforms.length > 0) { const transformCounts = transformVendorExtensions(spec, this.config.vendorExtensionTransforms); @@ -1058,19 +1251,19 @@ class OpenAPIProcessor { } } - // 9. Enforce msgpack-only endpoints if configured + // Enforce msgpack-only endpoints if configured if (this.config.msgpackOnlyEndpoints && this.config.msgpackOnlyEndpoints.length > 0) { const msgpackCount = enforceEndpointFormat(spec, this.config.msgpackOnlyEndpoints, "msgpack"); console.log(`ℹ️ Enforced msgpack-only format for ${msgpackCount} endpoint parameters/responses`); } - // 10. Enforce json-only endpoints if configured + // Enforce json-only endpoints if configured if (this.config.jsonOnlyEndpoints && this.config.jsonOnlyEndpoints.length > 0) { const jsonCount = enforceEndpointFormat(spec, this.config.jsonOnlyEndpoints, "json"); console.log(`ℹ️ Enforced json-only format for ${jsonCount} endpoint parameters/responses`); } - // 11. Create custom schemas if configured + // Create custom schemas if configured if (this.config.customSchemas && this.config.customSchemas.length > 0) { let customSchemaCount = 0; let linkedPropertiesCount = 0; @@ -1452,7 +1645,40 @@ async function processKmdSpec() { const config: ProcessingConfig = { sourceUrl: `https://raw.githubusercontent.com/algorand/go-algorand/${stableTag}/daemon/kmd/api/swagger.json`, outputPath: join(process.cwd(), "specs", "kmd.oas3.json"), - stripKmdApiVersionPrefixes: true, + schemaRenames: [ + { from: "APIV1DELETEKeyResponse", to: "DeleteKeyResponse" }, + { from: "APIV1DELETEMultisigResponse", to: "DeleteMultisigResponse" }, + { from: "APIV1GETWalletsResponse", to: "ListWalletsResponse" }, + { from: "APIV1POSTKeyExportResponse", to: "ExportKeyResponse" }, + { from: "APIV1POSTKeyImportResponse", to: "ImportKeyResponse" }, + { from: "APIV1POSTKeyListResponse", to: "ListKeysResponse" }, + { from: "APIV1POSTKeyResponse", to: "GenerateKeyResponse" }, + { from: "APIV1POSTMasterKeyExportResponse", to: "ExportMasterKeyResponse" }, + { from: "APIV1POSTMultisigExportResponse", to: "ExportMultisigResponse" }, + { from: "APIV1POSTMultisigImportResponse", to: "ImportMultisigResponse" }, + { from: "APIV1POSTMultisigListResponse", to: "ListMultisigResponse" }, + { from: "APIV1POSTMultisigProgramSignResponse", to: "SignProgramMultisigResponse" }, + { from: "APIV1POSTMultisigTransactionSignResponse", to: "SignMultisigResponse" }, + { from: "APIV1POSTProgramSignResponse", to: "SignProgramResponse" }, + { from: "APIV1POSTTransactionSignResponse", to: "SignTransactionResponse" }, + { from: "APIV1POSTWalletInfoResponse", to: "WalletInfoResponse" }, + { from: "APIV1POSTWalletInitResponse", to: "InitWalletHandleTokenResponse" }, + { from: "APIV1POSTWalletReleaseResponse", to: "ReleaseWalletHandleTokenResponse" }, + { from: "APIV1POSTWalletRenameResponse", to: "RenameWalletResponse" }, + { from: "APIV1POSTWalletRenewResponse", to: "RenewWalletHandleTokenResponse" }, + { from: "APIV1POSTWalletResponse", to: "CreateWalletResponse" }, + { from: "APIV1Wallet", to: "Wallet" }, + { from: "APIV1WalletHandle", to: "WalletHandle" }, + ], + removeSchemaProperties: ["error", "message", "display_mnemonic"], + makeAllFieldsRequired: true, + requiredFieldTransforms: [ + { + schemaName: "CreateWalletRequest", + fieldName: ["master_derivation_key", "wallet_driver_name"], + makeRequired: false, + }, + ], fieldTransforms: [ { fieldName: "private_key", @@ -1478,6 +1704,13 @@ async function processKmdSpec() { targetValue: "ListMultisig", removeSource: false, }, + { + sourceProperty: "operationId", + sourceValue: "InitWalletHandleToken", + targetProperty: "operationId", + targetValue: "InitWalletHandle", + removeSource: false, + }, ], }; diff --git a/specs/kmd.oas3.json b/specs/kmd.oas3.json index 5b5f85b..be3816b 100644 --- a/specs/kmd.oas3.json +++ b/specs/kmd.oas3.json @@ -63,7 +63,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyResponse" + "$ref": "#/components/schemas/GenerateKeyResponse" } } } @@ -88,13 +88,7 @@ "responses": { "200": { "description": "Response to `DELETE /v1/key`", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DELETEKeyResponse" - } - } - } + "content": {} } }, "x-codegen-request-body-name": "Delete Key Request" @@ -121,7 +115,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyExportResponse" + "$ref": "#/components/schemas/ExportKeyResponse" } } } @@ -151,7 +145,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyImportResponse" + "$ref": "#/components/schemas/ImportKeyResponse" } } } @@ -181,7 +175,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyListResponse" + "$ref": "#/components/schemas/ListKeysResponse" } } } @@ -211,7 +205,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMasterKeyExportResponse" + "$ref": "#/components/schemas/ExportMasterKeyResponse" } } } @@ -238,13 +232,7 @@ "responses": { "200": { "description": "Response to POST /v1/multisig/delete", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DELETEMultisigResponse" - } - } - } + "content": {} } }, "x-codegen-request-body-name": "Delete Multisig Request" @@ -271,7 +259,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigExportResponse" + "$ref": "#/components/schemas/ExportMultisigResponse" } } } @@ -301,7 +289,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigImportResponse" + "$ref": "#/components/schemas/ImportMultisigResponse" } } } @@ -331,7 +319,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigListResponse" + "$ref": "#/components/schemas/ListMultisigResponse" } } } @@ -361,7 +349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigTransactionSignResponse" + "$ref": "#/components/schemas/SignMultisigResponse" } } } @@ -391,7 +379,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigProgramSignResponse" + "$ref": "#/components/schemas/SignProgramMultisigResponse" } } } @@ -421,7 +409,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTProgramSignResponse" + "$ref": "#/components/schemas/SignProgramResponse" } } } @@ -451,7 +439,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTTransactionSignResponse" + "$ref": "#/components/schemas/SignTransactionResponse" } } } @@ -481,7 +469,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletResponse" + "$ref": "#/components/schemas/CreateWalletResponse" } } } @@ -511,7 +499,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletInfoResponse" + "$ref": "#/components/schemas/WalletInfoResponse" } } } @@ -524,7 +512,7 @@ "post": { "summary": "Initialize a wallet handle token", "description": "Unlock the wallet and return a wallet handle token that can be used for subsequent operations. These tokens expire periodically and must be renewed. You can `POST` the token to `/v1/wallet/info` to see how much time remains until expiration, and renew it with `/v1/wallet/renew`. When you're done, you can invalidate the token with `/v1/wallet/release`.\n", - "operationId": "InitWalletHandleToken", + "operationId": "InitWalletHandle", "requestBody": { "content": { "application/json": { @@ -541,7 +529,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletInitResponse" + "$ref": "#/components/schemas/InitWalletHandleTokenResponse" } } } @@ -568,13 +556,7 @@ "responses": { "200": { "description": "Response to `POST /v1/wallet/release`", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/POSTWalletReleaseResponse" - } - } - } + "content": {} } }, "x-codegen-request-body-name": "Release Wallet Handle Token Request" @@ -601,7 +583,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletRenameResponse" + "$ref": "#/components/schemas/RenameWalletResponse" } } } @@ -631,7 +613,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletRenewResponse" + "$ref": "#/components/schemas/RenewWalletHandleTokenResponse" } } } @@ -661,7 +643,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GETWalletsResponse" + "$ref": "#/components/schemas/ListWalletsResponse" } } } @@ -702,51 +684,9 @@ }, "components": { "schemas": { - "DELETEKeyResponse": { - "type": "object", - "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - } - }, - "description": "APIV1DELETEKeyResponse is the response to `DELETE /v1/key`\nfriendly:DeleteKeyResponse", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", - "x-algokit-original-name": "APIV1DELETEKeyResponse", - "x-algokit-kmd-api-version": 1 - }, - "DELETEMultisigResponse": { - "type": "object", - "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - } - }, - "description": "APIV1DELETEMultisigResponse is the response to POST /v1/multisig/delete`\nfriendly:DeleteMultisigResponse", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", - "x-algokit-original-name": "APIV1DELETEMultisigResponse", - "x-algokit-kmd-api-version": 1 - }, - "GETWalletsResponse": { + "ListWalletsResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallets": { "type": "array", "items": { @@ -755,54 +695,44 @@ "x-go-name": "Wallets" } }, - "description": "APIV1GETWalletsResponse is the response to `GET /v1/wallets`\nfriendly:ListWalletsResponse", + "description": "ListWalletsResponse is the response to `GET /v1/wallets`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1GETWalletsResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallets" + ] }, - "POSTKeyExportResponse": { + "ExportKeyResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "private_key": { "type": "string", "x-algokit-bytes-base64": true } }, - "description": "APIV1POSTKeyExportResponse is the response to `POST /v1/key/export`\nfriendly:ExportKeyResponse", + "description": "ExportKeyResponse is the response to `POST /v1/key/export`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTKeyExportResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "private_key" + ] }, - "POSTKeyImportResponse": { + "ImportKeyResponse": { "type": "object", "properties": { "address": { "type": "string", "x-go-name": "Address" - }, - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTKeyImportResponse is the response to `POST /v1/key/import`\nfriendly:ImportKeyResponse", + "description": "ImportKeyResponse is the response to `POST /v1/key/import`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTKeyImportResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "address" + ] }, - "POSTKeyListResponse": { + "ListKeysResponse": { "type": "object", "properties": { "addresses": { @@ -811,73 +741,47 @@ "type": "string" }, "x-go-name": "Addresses" - }, - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTKeyListResponse is the response to `POST /v1/key/list`\nfriendly:ListKeysResponse", + "description": "ListKeysResponse is the response to `POST /v1/key/list`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTKeyListResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "addresses" + ] }, - "POSTKeyResponse": { + "GenerateKeyResponse": { "type": "object", "properties": { "address": { "type": "string", "x-go-name": "Address" - }, - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTKeyResponse is the response to `POST /v1/key`\nfriendly:GenerateKeyResponse", + "description": "GenerateKeyResponse is the response to `POST /v1/key`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTKeyResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "address" + ] }, - "POSTMasterKeyExportResponse": { + "ExportMasterKeyResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, "master_derivation_key": { "$ref": "#/components/schemas/MasterDerivationKey" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTMasterKeyExportResponse is the response to `POST /v1/master-key/export`\nfriendly:ExportMasterKeyResponse", + "description": "ExportMasterKeyResponse is the response to `POST /v1/master-key/export`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMasterKeyExportResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "master_derivation_key" + ] }, - "POSTMultisigExportResponse": { + "ExportMultisigResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "multisig_version": { "type": "integer", "format": "uint8", @@ -896,33 +800,31 @@ "x-go-name": "Threshold" } }, - "description": "APIV1POSTMultisigExportResponse is the response to `POST /v1/multisig/export`\nfriendly:ExportMultisigResponse", + "description": "ExportMultisigResponse is the response to `POST /v1/multisig/export`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMultisigExportResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "multisig_version", + "pks", + "threshold" + ] }, - "POSTMultisigImportResponse": { + "ImportMultisigResponse": { "type": "object", "properties": { "address": { "type": "string", "x-go-name": "Address" - }, - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTMultisigImportResponse is the response to `POST /v1/multisig/import`\nfriendly:ImportMultisigResponse", + "description": "ImportMultisigResponse is the response to `POST /v1/multisig/import`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMultisigImportResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "address" + ] }, - "POSTMultisigListResponse": { + "ListMultisigResponse": { "type": "object", "properties": { "addresses": { @@ -931,32 +833,18 @@ "type": "string" }, "x-go-name": "Addresses" - }, - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" } }, - "description": "APIV1POSTMultisigListResponse is the response to `POST /v1/multisig/list`\nfriendly:ListMultisigResponse", + "description": "ListMultisigResponse is the response to `POST /v1/multisig/list`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMultisigListResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "addresses" + ] }, - "POSTMultisigProgramSignResponse": { + "SignProgramMultisigResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "multisig": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", @@ -964,22 +852,16 @@ "x-go-name": "Multisig" } }, - "description": "APIV1POSTMultisigProgramSignResponse is the response to `POST /v1/multisig/signdata`\nfriendly:SignProgramMultisigResponse", + "description": "SignProgramMultisigResponse is the response to `POST /v1/multisig/signdata`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMultisigProgramSignResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "multisig" + ] }, - "POSTMultisigTransactionSignResponse": { + "SignMultisigResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "multisig": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", @@ -987,22 +869,16 @@ "x-go-name": "Multisig" } }, - "description": "APIV1POSTMultisigTransactionSignResponse is the response to `POST /v1/multisig/sign`\nfriendly:SignMultisigResponse", + "description": "SignMultisigResponse is the response to `POST /v1/multisig/sign`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTMultisigTransactionSignResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "multisig" + ] }, - "POSTProgramSignResponse": { + "SignProgramResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "sig": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", @@ -1010,22 +886,16 @@ "x-go-name": "Signature" } }, - "description": "APIV1POSTProgramSignResponse is the response to `POST /v1/data/sign`\nfriendly:SignProgramResponse", + "description": "SignProgramResponse is the response to `POST /v1/data/sign`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTProgramSignResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "sig" + ] }, - "POSTTransactionSignResponse": { + "SignTransactionResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "signed_transaction": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", @@ -1033,128 +903,83 @@ "x-go-name": "SignedTransaction" } }, - "description": "APIV1POSTTransactionSignResponse is the response to `POST /v1/transaction/sign`\nfriendly:SignTransactionResponse", + "description": "SignTransactionResponse is the response to `POST /v1/transaction/sign`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTTransactionSignResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "signed_transaction" + ] }, - "POSTWalletInfoResponse": { + "WalletInfoResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallet_handle": { "$ref": "#/components/schemas/WalletHandle" } }, - "description": "APIV1POSTWalletInfoResponse is the response to `POST /v1/wallet/info`\nfriendly:WalletInfoResponse", + "description": "WalletInfoResponse is the response to `POST /v1/wallet/info`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTWalletInfoResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallet_handle" + ] }, - "POSTWalletInitResponse": { + "InitWalletHandleTokenResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallet_handle_token": { "type": "string", "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTWalletInitResponse is the response to `POST /v1/wallet/init`\nfriendly:InitWalletHandleTokenResponse", + "description": "InitWalletHandleTokenResponse is the response to `POST /v1/wallet/init`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTWalletInitResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallet_handle_token" + ] }, - "POSTWalletReleaseResponse": { - "type": "object", - "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - } - }, - "description": "APIV1POSTWalletReleaseResponse is the response to `POST /v1/wallet/release`\nfriendly:ReleaseWalletHandleTokenResponse", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", - "x-algokit-original-name": "APIV1POSTWalletReleaseResponse", - "x-algokit-kmd-api-version": 1 - }, - "POSTWalletRenameResponse": { + "RenameWalletResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallet": { "$ref": "#/components/schemas/Wallet" } }, - "description": "APIV1POSTWalletRenameResponse is the response to `POST /v1/wallet/rename`\nfriendly:RenameWalletResponse", + "description": "RenameWalletResponse is the response to `POST /v1/wallet/rename`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTWalletRenameResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallet" + ] }, - "POSTWalletRenewResponse": { + "RenewWalletHandleTokenResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallet_handle": { "$ref": "#/components/schemas/WalletHandle" } }, - "description": "APIV1POSTWalletRenewResponse is the response to `POST /v1/wallet/renew`\nfriendly:RenewWalletHandleTokenResponse", + "description": "RenewWalletHandleTokenResponse is the response to `POST /v1/wallet/renew`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTWalletRenewResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallet_handle" + ] }, - "POSTWalletResponse": { + "CreateWalletResponse": { "type": "object", "properties": { - "error": { - "type": "boolean", - "x-go-name": "Error" - }, - "message": { - "type": "string", - "x-go-name": "Message" - }, "wallet": { "$ref": "#/components/schemas/Wallet" } }, - "description": "APIV1POSTWalletResponse is the response to `POST /v1/wallet`\nfriendly:CreateWalletResponse", + "description": "CreateWalletResponse is the response to `POST /v1/wallet`", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1POSTWalletResponse", - "x-algokit-kmd-api-version": 1 + "required": [ + "wallet" + ] }, "Wallet": { "type": "object", @@ -1188,10 +1013,17 @@ "x-go-name": "SupportedTransactions" } }, - "description": "APIV1Wallet is the API's representation of a wallet", + "description": "Wallet is the API's representation of a wallet", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1Wallet", - "x-algokit-kmd-api-version": 1 + "required": [ + "driver_name", + "driver_version", + "id", + "mnemonic_ux", + "name", + "supported_txs" + ] }, "WalletHandle": { "type": "object", @@ -1205,10 +1037,13 @@ "$ref": "#/components/schemas/Wallet" } }, - "description": "APIV1WalletHandle includes the wallet the handle corresponds to\nand the number of number of seconds to expiration", + "description": "WalletHandle includes the wallet the handle corresponds to\nand the number of number of seconds to expiration", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "x-algokit-original-name": "APIV1WalletHandle", - "x-algokit-kmd-api-version": 1 + "required": [ + "expires_seconds", + "wallet" + ] }, "CreateWalletRequest": { "type": "object", @@ -1231,7 +1066,11 @@ }, "description": "APIV1POSTWalletRequest is the request for `POST /v1/wallet`", "x-go-name": "APIV1POSTWalletRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_name", + "wallet_password" + ] }, "DeleteKeyRequest": { "type": "object", @@ -1251,7 +1090,12 @@ }, "description": "APIV1DELETEKeyRequest is the request for `DELETE /v1/key`", "x-go-name": "APIV1DELETEKeyRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "wallet_handle_token", + "wallet_password" + ] }, "DeleteMultisigRequest": { "type": "object", @@ -1271,7 +1115,12 @@ }, "description": "APIV1DELETEMultisigRequest is the request for `DELETE /v1/multisig`", "x-go-name": "APIV1DELETEMultisigRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "wallet_handle_token", + "wallet_password" + ] }, "Digest": { "title": "Digest represents a 32-byte value holding the 256-bit Hash digest.", @@ -1300,7 +1149,12 @@ }, "description": "APIV1POSTKeyExportRequest is the request for `POST /v1/key/export`", "x-go-name": "APIV1POSTKeyExportRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "wallet_handle_token", + "wallet_password" + ] }, "ExportMasterKeyRequest": { "type": "object", @@ -1316,7 +1170,11 @@ }, "description": "APIV1POSTMasterKeyExportRequest is the request for `POST /v1/master-key/export`", "x-go-name": "APIV1POSTMasterKeyExportRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token", + "wallet_password" + ] }, "ExportMultisigRequest": { "type": "object", @@ -1332,15 +1190,15 @@ }, "description": "APIV1POSTMultisigExportRequest is the request for `POST /v1/multisig/export`", "x-go-name": "APIV1POSTMultisigExportRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "wallet_handle_token" + ] }, "GenerateKeyRequest": { "type": "object", "properties": { - "display_mnemonic": { - "type": "boolean", - "x-go-name": "DisplayMnemonic" - }, "wallet_handle_token": { "type": "string", "x-go-name": "WalletHandleToken" @@ -1348,7 +1206,10 @@ }, "description": "APIV1POSTKeyRequest is the request for `POST /v1/key`", "x-go-name": "APIV1POSTKeyRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "ImportKeyRequest": { "type": "object", @@ -1364,7 +1225,11 @@ }, "description": "APIV1POSTKeyImportRequest is the request for `POST /v1/key/import`", "x-go-name": "APIV1POSTKeyImportRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "private_key", + "wallet_handle_token" + ] }, "ImportMultisigRequest": { "type": "object", @@ -1393,7 +1258,13 @@ }, "description": "APIV1POSTMultisigImportRequest is the request for `POST /v1/multisig/import`", "x-go-name": "APIV1POSTMultisigImportRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "multisig_version", + "pks", + "threshold", + "wallet_handle_token" + ] }, "InitWalletHandleTokenRequest": { "type": "object", @@ -1409,7 +1280,11 @@ }, "description": "APIV1POSTWalletInitRequest is the request for `POST /v1/wallet/init`", "x-go-name": "APIV1POSTWalletInitRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_id", + "wallet_password" + ] }, "ListKeysRequest": { "type": "object", @@ -1421,7 +1296,10 @@ }, "description": "APIV1POSTKeyListRequest is the request for `POST /v1/key/list`", "x-go-name": "APIV1POSTKeyListRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "ListMultisigRequest": { "type": "object", @@ -1433,7 +1311,10 @@ }, "description": "APIV1POSTMultisigListRequest is the request for `POST /v1/multisig/list`", "x-go-name": "APIV1POSTMultisigListRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "ListWalletsRequest": { "type": "object", @@ -1469,7 +1350,12 @@ } }, "description": "MultisigSig is the structure that holds multiple Subsigs", - "x-go-package": "github.com/algorand/go-algorand/crypto" + "x-go-package": "github.com/algorand/go-algorand/crypto", + "required": [ + "Subsigs", + "Threshold", + "Version" + ] }, "MultisigSubsig": { "type": "object", @@ -1482,7 +1368,11 @@ } }, "description": "MultisigSubsig is a struct that holds a pair of public key and signatures\nsignatures may be empty", - "x-go-package": "github.com/algorand/go-algorand/crypto" + "x-go-package": "github.com/algorand/go-algorand/crypto", + "required": [ + "Key", + "Sig" + ] }, "PrivateKey": { "$ref": "#/components/schemas/ed25519PrivateKey" @@ -1500,7 +1390,10 @@ }, "description": "APIV1POSTWalletReleaseRequest is the request for `POST /v1/wallet/release`", "x-go-name": "APIV1POSTWalletReleaseRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "RenameWalletRequest": { "type": "object", @@ -1520,7 +1413,12 @@ }, "description": "APIV1POSTWalletRenameRequest is the request for `POST /v1/wallet/rename`", "x-go-name": "APIV1POSTWalletRenameRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_id", + "wallet_name", + "wallet_password" + ] }, "RenewWalletHandleTokenRequest": { "type": "object", @@ -1532,7 +1430,10 @@ }, "description": "APIV1POSTWalletRenewRequest is the request for `POST /v1/wallet/renew`", "x-go-name": "APIV1POSTWalletRenewRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "SignMultisigRequest": { "type": "object", @@ -1563,7 +1464,15 @@ }, "description": "APIV1POSTMultisigTransactionSignRequest is the request for `POST /v1/multisig/sign`", "x-go-name": "APIV1POSTMultisigTransactionSignRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "partial_multisig", + "public_key", + "signer", + "transaction", + "wallet_handle_token", + "wallet_password" + ] }, "SignProgramMultisigRequest": { "type": "object", @@ -1599,7 +1508,16 @@ }, "description": "APIV1POSTMultisigProgramSignRequest is the request for `POST /v1/multisig/signprogram`", "x-go-name": "APIV1POSTMultisigProgramSignRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "data", + "partial_multisig", + "public_key", + "use_legacy_msig", + "wallet_handle_token", + "wallet_password" + ] }, "SignProgramRequest": { "type": "object", @@ -1625,7 +1543,13 @@ }, "description": "APIV1POSTProgramSignRequest is the request for `POST /v1/program/sign`", "x-go-name": "APIV1POSTProgramSignRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "address", + "data", + "wallet_handle_token", + "wallet_password" + ] }, "SignTransactionRequest": { "type": "object", @@ -1651,7 +1575,13 @@ }, "description": "APIV1POSTTransactionSignRequest is the request for `POST /v1/transaction/sign`", "x-go-name": "APIV1POSTTransactionSignRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "public_key", + "transaction", + "wallet_handle_token", + "wallet_password" + ] }, "Signature": { "$ref": "#/components/schemas/ed25519Signature" @@ -1678,7 +1608,10 @@ } }, "description": "VersionsResponse is the response to `GET /versions`\nfriendly:VersionsResponse", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "versions" + ] }, "WalletInfoRequest": { "type": "object", @@ -1690,7 +1623,10 @@ }, "description": "APIV1POSTWalletInfoRequest is the request for `POST /v1/wallet/info`", "x-go-name": "APIV1POSTWalletInfoRequest", - "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" + "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "required": [ + "wallet_handle_token" + ] }, "ed25519PrivateKey": { "type": "array", @@ -1724,37 +1660,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletResponse" + "$ref": "#/components/schemas/CreateWalletResponse" } } } }, "DeleteKeyResponse": { "description": "Response to `DELETE /v1/key`", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DELETEKeyResponse" - } - } - } + "content": {} }, "DeleteMultisigResponse": { "description": "Response to POST /v1/multisig/delete", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DELETEMultisigResponse" - } - } - } + "content": {} }, "ExportKeyResponse": { "description": "Response to `POST /v1/key/export`", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyExportResponse" + "$ref": "#/components/schemas/ExportKeyResponse" } } } @@ -1764,7 +1688,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMasterKeyExportResponse" + "$ref": "#/components/schemas/ExportMasterKeyResponse" } } } @@ -1774,7 +1698,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigExportResponse" + "$ref": "#/components/schemas/ExportMultisigResponse" } } } @@ -1784,7 +1708,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyResponse" + "$ref": "#/components/schemas/GenerateKeyResponse" } } } @@ -1794,7 +1718,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyImportResponse" + "$ref": "#/components/schemas/ImportKeyResponse" } } } @@ -1804,7 +1728,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigImportResponse" + "$ref": "#/components/schemas/ImportMultisigResponse" } } } @@ -1814,7 +1738,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletInitResponse" + "$ref": "#/components/schemas/InitWalletHandleTokenResponse" } } } @@ -1824,7 +1748,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTKeyListResponse" + "$ref": "#/components/schemas/ListKeysResponse" } } } @@ -1834,7 +1758,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigListResponse" + "$ref": "#/components/schemas/ListMultisigResponse" } } } @@ -1844,27 +1768,21 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/GETWalletsResponse" + "$ref": "#/components/schemas/ListWalletsResponse" } } } }, "ReleaseWalletHandleTokenResponse": { "description": "Response to `POST /v1/wallet/release`", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/POSTWalletReleaseResponse" - } - } - } + "content": {} }, "RenameWalletResponse": { "description": "Response to `POST /v1/wallet/rename`", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletRenameResponse" + "$ref": "#/components/schemas/RenameWalletResponse" } } } @@ -1874,7 +1792,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletRenewResponse" + "$ref": "#/components/schemas/RenewWalletHandleTokenResponse" } } } @@ -1884,7 +1802,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigTransactionSignResponse" + "$ref": "#/components/schemas/SignMultisigResponse" } } } @@ -1894,7 +1812,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTMultisigProgramSignResponse" + "$ref": "#/components/schemas/SignProgramMultisigResponse" } } } @@ -1904,7 +1822,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTProgramSignResponse" + "$ref": "#/components/schemas/SignProgramResponse" } } } @@ -1914,7 +1832,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTTransactionSignResponse" + "$ref": "#/components/schemas/SignTransactionResponse" } } } @@ -1934,7 +1852,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/POSTWalletInfoResponse" + "$ref": "#/components/schemas/WalletInfoResponse" } } } From d61bf30e263ac16c2a155f73a9ff0d78b6a44e81 Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Tue, 2 Dec 2025 23:34:27 +0800 Subject: [PATCH 10/12] chore: kmd refinements --- main.ts | 241 +++++++++++++++++++++++++++++++++++++++++--- specs/kmd.oas3.json | 158 +++++++++++++++-------------- 2 files changed, 310 insertions(+), 89 deletions(-) diff --git a/main.ts b/main.ts index 3179bb4..85f2d84 100644 --- a/main.ts +++ b/main.ts @@ -65,6 +65,11 @@ interface SchemaRename { to: string; // New schema name } +interface SchemaFieldRename { + schemaName: string; // Schema name to target + fieldRenames: { from: string; to: string }[]; // Field renames to apply +} + interface ProcessingConfig { sourceUrl: string; outputPath: string; @@ -78,8 +83,10 @@ interface ProcessingConfig { customSchemas?: CustomSchema[]; // Schema renames to apply schemaRenames?: SchemaRename[]; - // Property names to remove from all schemas (e.g., ["error", "message"]) - removeSchemaProperties?: string[]; + // Schema field renames to apply (actual field name changes) + schemaFieldRenames?: SchemaFieldRename[]; + // Field names to remove from all schemas (e.g., ["error", "message"]) + removeSchemaFields?: string[]; // Make all properties required in all schemas makeAllFieldsRequired?: boolean; } @@ -897,12 +904,58 @@ function renameSchemas(spec: OpenAPISpec, renames: SchemaRename[]): number { } /** - * Remove specified properties from all schemas in the spec + * Rename fields within schemas (actual field name changes, not just metadata) + */ +function renameSchemaFields(spec: OpenAPISpec, fieldRenames: SchemaFieldRename[]): number { + let renamedCount = 0; + + if (!spec.components?.schemas || !fieldRenames || fieldRenames.length === 0) { + return renamedCount; + } + + const schemas = spec.components.schemas as Record; + + for (const config of fieldRenames) { + const schema = schemas[config.schemaName]; + + if (!schema || typeof schema !== "object" || !schema.properties) { + console.warn(`⚠️ Schema '${config.schemaName}' not found or has no properties, skipping field renames`); + continue; + } + + for (const rename of config.fieldRenames) { + if (!schema.properties.hasOwnProperty(rename.from)) { + console.warn(`⚠️ Field '${rename.from}' not found in schema '${config.schemaName}', skipping rename`); + continue; + } + + // Rename the field + schema.properties[rename.to] = schema.properties[rename.from]; + delete schema.properties[rename.from]; + + // Update required array if it exists + if (schema.required && Array.isArray(schema.required)) { + const index = schema.required.indexOf(rename.from); + if (index !== -1) { + schema.required[index] = rename.to; + } + } + + renamedCount++; + console.log(`ℹ️ Renamed field '${rename.from}' to '${rename.to}' in schema '${config.schemaName}'`); + } + } + + return renamedCount; +} + +/** + * Remove specified fields from all schemas in the spec */ -function removeSchemaProperties(spec: OpenAPISpec, propertiesToRemove: string[]): number { +function removeSchemaFields(spec: OpenAPISpec, fieldsToRemove: string[]): number { let removedCount = 0; - if (!spec.components?.schemas || !propertiesToRemove || propertiesToRemove.length === 0) { + if (!spec.components?.schemas || !fieldsToRemove || fieldsToRemove.length === 0) { return removedCount; } @@ -913,11 +966,11 @@ function removeSchemaProperties(spec: OpenAPISpec, propertiesToRemove: string[]) continue; } - for (const propertyName of propertiesToRemove) { - if (schema.properties.hasOwnProperty(propertyName)) { - delete schema.properties[propertyName]; + for (const fieldName of fieldsToRemove) { + if (schema.properties.hasOwnProperty(fieldName)) { + delete schema.properties[fieldName]; removedCount++; - console.log(`ℹ️ Removed property '${propertyName}' from schema '${schemaName}'`); + console.log(`ℹ️ Removed field '${fieldName}' from schema '${schemaName}'`); } } } @@ -1081,6 +1134,27 @@ class OpenAPIProcessor { ["ana ccount", "an account"], ["since eposh", "since epoch"], ["* update\\n* update\\n* delete", "* update\\n* delete"], + ["APIV1POSTWalletRenameRequest is the", "The"], + ["APIV1POSTWalletRequest is the", "The"], + ["APIV1DELETEKeyRequest is the", "The"], + ["APIV1DELETEMultisigRequest is the", "The"], + ["APIV1POSTKeyExportRequest is the", "The"], + ["APIV1POSTMasterKeyExportRequest is the", "The"], + ["APIV1POSTMultisigExportRequest is the", "The"], + ["APIV1POSTKeyRequest is the", "The"], + ["APIV1POSTKeyImportRequest is the", "The"], + ["APIV1POSTMultisigImportRequest is the", "The"], + ["APIV1POSTWalletInitRequest is the", "The"], + ["APIV1POSTKeyListRequest is the", "The"], + ["APIV1POSTMultisigListRequest is the", "The"], + ["APIV1POSTWalletReleaseRequest is the", "The"], + ["APIV1POSTWalletRenameRequest is the", "The"], + ["APIV1POSTWalletRenewRequest is the", "The"], + ["APIV1POSTMultisigTransactionSignRequest is the", "The"], + ["APIV1POSTProgramSignRequest is the", "The"], + ["APIV1POSTTransactionSignRequest is the", "The"], + ["APIV1POSTWalletInfoRequest is the", "The"], + ["APIV1POSTMultisigProgramSignRequest is the", "The"], ]; return patches.reduce((text, [find, replace]) => text.replaceAll(find, replace), content); @@ -1184,10 +1258,16 @@ class OpenAPIProcessor { } } - // Remove specified schema properties if configured (KMD error/message cleanup) - if (this.config.removeSchemaProperties && this.config.removeSchemaProperties.length > 0) { - const removedCount = removeSchemaProperties(spec, this.config.removeSchemaProperties); - console.log(`ℹ️ Removed ${removedCount} properties from schemas`); + // Rename schema fields if configured (e.g., MultisigSig field names in KMD) + if (this.config.schemaFieldRenames && this.config.schemaFieldRenames.length > 0) { + const renamedCount = renameSchemaFields(spec, this.config.schemaFieldRenames); + console.log(`ℹ️ Renamed ${renamedCount} fields in schemas`); + } + + // Remove specified schema fields if configured (KMD error/message cleanup) + if (this.config.removeSchemaFields && this.config.removeSchemaFields.length > 0) { + const removedCount = removeSchemaFields(spec, this.config.removeSchemaFields); + console.log(`ℹ️ Removed ${removedCount} fields from schemas`); // After removing properties, check for and remove schemas that now have no properties const { removedSchemas, updatedReferences } = removeEmptySchemas(spec); @@ -1669,8 +1749,28 @@ async function processKmdSpec() { { from: "APIV1POSTWalletResponse", to: "CreateWalletResponse" }, { from: "APIV1Wallet", to: "Wallet" }, { from: "APIV1WalletHandle", to: "WalletHandle" }, + // These are renamed, so we can use the original name for a customised type + { from: "SignMultisigRequest", to: "SignMultisigTxnRequest" }, + { from: "SignTransactionRequest", to: "SignTxnRequest" }, + ], + schemaFieldRenames: [ + { + schemaName: "MultisigSig", + fieldRenames: [ + { from: "Subsigs", to: "subsig" }, + { from: "Threshold", to: "thr" }, + { from: "Version", to: "v" }, + ], + }, + { + schemaName: "MultisigSubsig", + fieldRenames: [ + { from: "Key", to: "pk" }, + { from: "Sig", to: "s" }, + ], + }, ], - removeSchemaProperties: ["error", "message", "display_mnemonic"], + removeSchemaFields: ["error", "message", "display_mnemonic"], makeAllFieldsRequired: true, requiredFieldTransforms: [ { @@ -1678,6 +1778,51 @@ async function processKmdSpec() { fieldName: ["master_derivation_key", "wallet_driver_name"], makeRequired: false, }, + { + schemaName: "SignTxnRequest", + fieldName: ["wallet_password", "public_key"], + makeRequired: false, + }, + { + schemaName: "SignProgramMultisigRequest", + fieldName: ["wallet_password", "partial_multisig", "use_legacy_msig"], + makeRequired: false, + }, + { + schemaName: "SignMultisigTxnRequest", + fieldName: ["wallet_password", "partial_multisig", "signer"], + makeRequired: false, + }, + { + schemaName: "DeleteKeyRequest", + fieldName: ["wallet_password"], + makeRequired: false, + }, + { + schemaName: "DeleteMultisigRequest", + fieldName: ["wallet_password"], + makeRequired: false, + }, + { + schemaName: "ExportKeyRequest", + fieldName: ["wallet_password"], + makeRequired: false, + }, + { + schemaName: "ExportMasterKeyRequest", + fieldName: ["wallet_password"], + makeRequired: false, + }, + { + schemaName: "SignProgramRequest", + fieldName: ["wallet_password"], + makeRequired: false, + }, + { + schemaName: "MultisigSubsig", + fieldName: ["s"], // TODO: NC - Confirm if this is correct + makeRequired: false, + }, ], fieldTransforms: [ { @@ -1688,6 +1833,67 @@ async function processKmdSpec() { "x-algokit-bytes-base64": true, }, }, + { + schemaName: "MultisigSig", + fieldName: "subsig", + addItems: { + "x-algokit-field-rename": "subsignatures", + }, + }, + { + schemaName: "MultisigSig", + fieldName: "thr", + addItems: { + "x-algokit-field-rename": "threshold", + }, + }, + { + schemaName: "MultisigSig", + fieldName: "v", + addItems: { + "x-algokit-field-rename": "version", + }, + }, + { + schemaName: "MultisigSubsig", + fieldName: "pk", + addItems: { + "x-algokit-field-rename": "publicKey", + }, + }, + { + schemaName: "MultisigSubsig", + fieldName: "s", + addItems: { + "x-algokit-field-rename": "signature", + }, + }, + { + schemaName: "SignProgramRequest", + fieldName: "data", + addItems: { + "x-algokit-field-rename": "program", + }, + }, + { + schemaName: "SignProgramMultisigRequest", + fieldName: "data", + addItems: { + "x-algokit-field-rename": "program", + }, + }, + { + fieldName: "addresses.items", + addItems: { + "x-algorand-format": "Address", + }, + }, + { + fieldName: "pks", + addItems: { + "x-algokit-field-rename": "publicKeys", + }, + }, ], vendorExtensionTransforms: [ { @@ -1711,6 +1917,13 @@ async function processKmdSpec() { targetValue: "InitWalletHandle", removeSource: false, }, + { + sourceProperty: "x-go-name", + sourceValue: "Address", + targetProperty: "x-algorand-format", + targetValue: "Address", + removeSource: false, + }, ], }; diff --git a/specs/kmd.oas3.json b/specs/kmd.oas3.json index be3816b..12ff46d 100644 --- a/specs/kmd.oas3.json +++ b/specs/kmd.oas3.json @@ -337,7 +337,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignMultisigRequest" + "$ref": "#/components/schemas/SignMultisigTxnRequest" } } }, @@ -427,7 +427,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SignTransactionRequest" + "$ref": "#/components/schemas/SignTxnRequest" } } }, @@ -722,7 +722,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" } }, "description": "ImportKeyResponse is the response to `POST /v1/key/import`", @@ -738,7 +739,8 @@ "addresses": { "type": "array", "items": { - "type": "string" + "type": "string", + "x-algorand-format": "Address" }, "x-go-name": "Addresses" } @@ -755,7 +757,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" } }, "description": "GenerateKeyResponse is the response to `POST /v1/key`", @@ -792,7 +795,8 @@ "items": { "$ref": "#/components/schemas/PublicKey" }, - "x-go-name": "PKs" + "x-go-name": "PKs", + "x-algokit-field-rename": "publicKeys" }, "threshold": { "type": "integer", @@ -814,7 +818,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" } }, "description": "ImportMultisigResponse is the response to `POST /v1/multisig/import`", @@ -830,7 +835,8 @@ "addresses": { "type": "array", "items": { - "type": "string" + "type": "string", + "x-algorand-format": "Address" }, "x-go-name": "Addresses" } @@ -1064,7 +1070,7 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTWalletRequest is the request for `POST /v1/wallet`", + "description": "The request for `POST /v1/wallet`", "x-go-name": "APIV1POSTWalletRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1077,7 +1083,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "wallet_handle_token": { "type": "string", @@ -1088,13 +1095,12 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1DELETEKeyRequest is the request for `DELETE /v1/key`", + "description": "The request for `DELETE /v1/key`", "x-go-name": "APIV1DELETEKeyRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "address", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "DeleteMultisigRequest": { @@ -1102,7 +1108,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "wallet_handle_token": { "type": "string", @@ -1113,13 +1120,12 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1DELETEMultisigRequest is the request for `DELETE /v1/multisig`", + "description": "The request for `DELETE /v1/multisig`", "x-go-name": "APIV1DELETEMultisigRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "address", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "Digest": { @@ -1136,7 +1142,8 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "wallet_handle_token": { "type": "string", @@ -1147,13 +1154,12 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTKeyExportRequest is the request for `POST /v1/key/export`", + "description": "The request for `POST /v1/key/export`", "x-go-name": "APIV1POSTKeyExportRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "address", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "ExportMasterKeyRequest": { @@ -1168,12 +1174,11 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTMasterKeyExportRequest is the request for `POST /v1/master-key/export`", + "description": "The request for `POST /v1/master-key/export`", "x-go-name": "APIV1POSTMasterKeyExportRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "ExportMultisigRequest": { @@ -1181,14 +1186,15 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "wallet_handle_token": { "type": "string", "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTMultisigExportRequest is the request for `POST /v1/multisig/export`", + "description": "The request for `POST /v1/multisig/export`", "x-go-name": "APIV1POSTMultisigExportRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1204,7 +1210,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTKeyRequest is the request for `POST /v1/key`", + "description": "The request for `POST /v1/key`", "x-go-name": "APIV1POSTKeyRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1223,7 +1229,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTKeyImportRequest is the request for `POST /v1/key/import`", + "description": "The request for `POST /v1/key/import`", "x-go-name": "APIV1POSTKeyImportRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1244,7 +1250,8 @@ "items": { "$ref": "#/components/schemas/PublicKey" }, - "x-go-name": "PKs" + "x-go-name": "PKs", + "x-algokit-field-rename": "publicKeys" }, "threshold": { "type": "integer", @@ -1256,7 +1263,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTMultisigImportRequest is the request for `POST /v1/multisig/import`", + "description": "The request for `POST /v1/multisig/import`", "x-go-name": "APIV1POSTMultisigImportRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1278,7 +1285,7 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTWalletInitRequest is the request for `POST /v1/wallet/init`", + "description": "The request for `POST /v1/wallet/init`", "x-go-name": "APIV1POSTWalletInitRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1294,7 +1301,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTKeyListRequest is the request for `POST /v1/key/list`", + "description": "The request for `POST /v1/key/list`", "x-go-name": "APIV1POSTKeyListRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1309,7 +1316,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTMultisigListRequest is the request for `POST /v1/multisig/list`", + "description": "The request for `POST /v1/multisig/list`", "x-go-name": "APIV1POSTMultisigListRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1334,44 +1341,48 @@ "MultisigSig": { "type": "object", "properties": { - "Subsigs": { + "subsig": { "type": "array", "items": { "$ref": "#/components/schemas/MultisigSubsig" - } + }, + "x-algokit-field-rename": "subsignatures" }, - "Threshold": { + "thr": { "type": "integer", - "format": "uint8" + "format": "uint8", + "x-algokit-field-rename": "threshold" }, - "Version": { + "v": { "type": "integer", - "format": "uint8" + "format": "uint8", + "x-algokit-field-rename": "version" } }, "description": "MultisigSig is the structure that holds multiple Subsigs", "x-go-package": "github.com/algorand/go-algorand/crypto", "required": [ - "Subsigs", - "Threshold", - "Version" + "subsig", + "thr", + "v" ] }, "MultisigSubsig": { "type": "object", "properties": { - "Key": { - "$ref": "#/components/schemas/PublicKey" + "pk": { + "$ref": "#/components/schemas/PublicKey", + "x-algokit-field-rename": "publicKey" }, - "Sig": { - "$ref": "#/components/schemas/Signature" + "s": { + "$ref": "#/components/schemas/Signature", + "x-algokit-field-rename": "signature" } }, "description": "MultisigSubsig is a struct that holds a pair of public key and signatures\nsignatures may be empty", "x-go-package": "github.com/algorand/go-algorand/crypto", "required": [ - "Key", - "Sig" + "pk" ] }, "PrivateKey": { @@ -1388,7 +1399,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTWalletReleaseRequest is the request for `POST /v1/wallet/release`", + "description": "The request for `POST /v1/wallet/release`", "x-go-name": "APIV1POSTWalletReleaseRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1411,7 +1422,7 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTWalletRenameRequest is the request for `POST /v1/wallet/rename`", + "description": "The request for `POST /v1/wallet/rename`", "x-go-name": "APIV1POSTWalletRenameRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ @@ -1428,14 +1439,14 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTWalletRenewRequest is the request for `POST /v1/wallet/renew`", + "description": "The request for `POST /v1/wallet/renew`", "x-go-name": "APIV1POSTWalletRenewRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "wallet_handle_token" ] }, - "SignMultisigRequest": { + "SignMultisigTxnRequest": { "type": "object", "properties": { "partial_multisig": { @@ -1462,16 +1473,14 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTMultisigTransactionSignRequest is the request for `POST /v1/multisig/sign`", + "description": "The request for `POST /v1/multisig/sign`", "x-go-name": "APIV1POSTMultisigTransactionSignRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "x-algokit-original-name": "SignMultisigRequest", "required": [ - "partial_multisig", "public_key", - "signer", "transaction", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "SignProgramMultisigRequest": { @@ -1479,13 +1488,15 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "data": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", "format": "byte", - "x-go-name": "Program" + "x-go-name": "Program", + "x-algokit-field-rename": "program" }, "partial_multisig": { "$ref": "#/components/schemas/MultisigSig" @@ -1506,17 +1517,14 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTMultisigProgramSignRequest is the request for `POST /v1/multisig/signprogram`", + "description": "The request for `POST /v1/multisig/signprogram`", "x-go-name": "APIV1POSTMultisigProgramSignRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "address", "data", - "partial_multisig", "public_key", - "use_legacy_msig", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "SignProgramRequest": { @@ -1524,13 +1532,15 @@ "properties": { "address": { "type": "string", - "x-go-name": "Address" + "x-go-name": "Address", + "x-algorand-format": "Address" }, "data": { "pattern": "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", "type": "string", "format": "byte", - "x-go-name": "Program" + "x-go-name": "Program", + "x-algokit-field-rename": "program" }, "wallet_handle_token": { "type": "string", @@ -1541,17 +1551,16 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTProgramSignRequest is the request for `POST /v1/program/sign`", + "description": "The request for `POST /v1/program/sign`", "x-go-name": "APIV1POSTProgramSignRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ "address", "data", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, - "SignTransactionRequest": { + "SignTxnRequest": { "type": "object", "properties": { "public_key": { @@ -1573,14 +1582,13 @@ "x-go-name": "WalletPassword" } }, - "description": "APIV1POSTTransactionSignRequest is the request for `POST /v1/transaction/sign`", + "description": "The request for `POST /v1/transaction/sign`", "x-go-name": "APIV1POSTTransactionSignRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", + "x-algokit-original-name": "SignTransactionRequest", "required": [ - "public_key", "transaction", - "wallet_handle_token", - "wallet_password" + "wallet_handle_token" ] }, "Signature": { @@ -1621,7 +1629,7 @@ "x-go-name": "WalletHandleToken" } }, - "description": "APIV1POSTWalletInfoRequest is the request for `POST /v1/wallet/info`", + "description": "The request for `POST /v1/wallet/info`", "x-go-name": "APIV1POSTWalletInfoRequest", "x-go-package": "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi", "required": [ From cadcc29d1b967032327f80f97abc50e3793088af Mon Sep 17 00:00:00 2001 From: Altynbek Orumbayev Date: Wed, 3 Dec 2025 20:23:39 +0100 Subject: [PATCH 11/12] chore: deprecate dryrun endpoint by adding legacy tag. Adds the ability to transform endpoint tags based on configured rules. This allows for the addition or removal of tags on specific endpoints, enabling more granular control over API documentation and categorization. This change is used to mark the dryrun endpoint as legacy, as it's superseded by the simulate endpoint. --- main.ts | 78 +++++++++++++++++++++++++++++++++++++++++++ specs/algod.oas3.json | 3 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index dfc7106..331121f 100644 --- a/main.ts +++ b/main.ts @@ -70,6 +70,13 @@ interface SchemaFieldRename { fieldRenames: { from: string; to: string }[]; // Field renames to apply } +interface EndpointTagTransform { + path: string; // Exact path to match (e.g., "/v2/teal/dryrun") + methods?: string[]; // HTTP methods to apply to (default: all methods on the path) + addTags?: string[]; // Tags to add to the endpoint + removeTags?: string[]; // Tags to remove from the endpoint +} + interface ProcessingConfig { sourceUrl: string; outputPath: string; @@ -89,6 +96,8 @@ interface ProcessingConfig { removeSchemaFields?: string[]; // Make all properties required in all schemas makeAllFieldsRequired?: boolean; + // Endpoint tag transforms to add/remove tags from specific endpoints + endpointTagTransforms?: EndpointTagTransform[]; } // ===== OAS2 PRE-PROCESSING ===== @@ -1024,6 +1033,65 @@ function makeAllFieldsRequired(spec: OpenAPISpec): number { return modifiedCount; } +/** + * Transform endpoint tags by adding or removing tags from specific endpoints + */ +function transformEndpointTags(spec: OpenAPISpec, transforms: EndpointTagTransform[]): number { + let modifiedCount = 0; + + if (!spec.paths || !transforms?.length) { + return modifiedCount; + } + + const allMethods = ["get", "post", "put", "delete", "patch", "head", "options", "trace"]; + + for (const transform of transforms) { + const pathObj = spec.paths[transform.path]; + if (!pathObj) { + console.warn(`⚠️ Path ${transform.path} not found in spec for tag transform`); + continue; + } + + const methods = transform.methods || allMethods; + + for (const method of methods) { + const operation = pathObj[method]; + if (!operation) { + continue; + } + + // Initialize tags array if it doesn't exist + if (!operation.tags) { + operation.tags = []; + } + + // Remove tags if specified + if (transform.removeTags && transform.removeTags.length > 0) { + const originalLength = operation.tags.length; + operation.tags = operation.tags.filter((tag: string) => !transform.removeTags!.includes(tag)); + const removedCount = originalLength - operation.tags.length; + if (removedCount > 0) { + modifiedCount += removedCount; + console.log(`ℹ️ Removed ${removedCount} tag(s) from ${transform.path} (${method})`); + } + } + + // Add tags if specified + if (transform.addTags && transform.addTags.length > 0) { + for (const tag of transform.addTags) { + if (!operation.tags.includes(tag)) { + operation.tags.push(tag); + modifiedCount++; + console.log(`ℹ️ Added tag '${tag}' to ${transform.path} (${method})`); + } + } + } + } + } + + return modifiedCount; +} + /** * Remove schemas that have no properties and update all references to them */ @@ -1363,6 +1431,12 @@ class OpenAPIProcessor { } } + // Transform endpoint tags if configured + if (this.config.endpointTagTransforms && this.config.endpointTagTransforms.length > 0) { + const tagCount = transformEndpointTags(spec, this.config.endpointTagTransforms); + console.log(`ℹ️ Applied ${tagCount} endpoint tag transformations`); + } + // Save the processed spec await SwaggerParser.validate(JSON.parse(JSON.stringify(spec))); console.log("✅ Specification is valid"); @@ -1712,6 +1786,10 @@ async function processAlgodSpec() { linkToProperties: ["sourcemap"], }, ], + endpointTagTransforms: [ + // Mark dryrun endpoint as legacy (superseded by simulate) + { path: "/v2/teal/dryrun", methods: ["post"], addTags: ["legacy"] }, + ], }; await processAlgorandSpec(config); diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index d00df65..bbb0cb4 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -3759,7 +3759,8 @@ "post": { "tags": [ "public", - "nonparticipating" + "nonparticipating", + "legacy" ], "summary": "Provide debugging information for a transaction (or group).", "description": "Executes TEAL program(s) in context and returns debugging information about the execution. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.", From 8df3133055c07a3fdd8b10b94451db989b090f0d Mon Sep 17 00:00:00 2001 From: Neil Campbell Date: Thu, 4 Dec 2025 11:10:14 +0800 Subject: [PATCH 12/12] chore: adjust legacy to skip tag --- main.ts | 8 ++++++-- specs/algod.oas3.json | 11 +++++++---- specs/kmd.oas3.json | 5 ++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/main.ts b/main.ts index 331121f..2a25e90 100644 --- a/main.ts +++ b/main.ts @@ -1787,8 +1787,11 @@ async function processAlgodSpec() { }, ], endpointTagTransforms: [ - // Mark dryrun endpoint as legacy (superseded by simulate) - { path: "/v2/teal/dryrun", methods: ["post"], addTags: ["legacy"] }, + // Mark dryrun endpoint has been superseded by simulate + { path: "/v2/teal/dryrun", methods: ["post"], addTags: ["skip"] }, + { path: "/metrics", methods: ["get"], addTags: ["skip"] }, + { path: "/swagger.json", methods: ["get"], addTags: ["skip"] }, + { path: "/v2/blocks/{round}/logs", methods: ["get"], addTags: ["skip"] }, ], }; @@ -2009,6 +2012,7 @@ async function processKmdSpec() { removeSource: false, }, ], + endpointTagTransforms: [{ path: "/swagger.json", methods: ["get"], addTags: ["skip"] }], }; await processAlgorandSpec(config); diff --git a/specs/algod.oas3.json b/specs/algod.oas3.json index bbb0cb4..fe15b20 100644 --- a/specs/algod.oas3.json +++ b/specs/algod.oas3.json @@ -81,7 +81,8 @@ "get": { "tags": [ "public", - "common" + "common", + "skip" ], "summary": "Return metrics about algod functioning.", "operationId": "Metrics", @@ -128,7 +129,8 @@ "get": { "tags": [ "public", - "common" + "common", + "skip" ], "summary": "Gets the current swagger spec.", "description": "Returns the entire swagger spec in json.", @@ -1137,7 +1139,8 @@ "get": { "tags": [ "public", - "nonparticipating" + "nonparticipating", + "skip" ], "summary": "Get all of the logs from outer and inner app calls in the given round", "description": "Get all of the logs from outer and inner app calls in the given round", @@ -3760,7 +3763,7 @@ "tags": [ "public", "nonparticipating", - "legacy" + "skip" ], "summary": "Provide debugging information for a transaction (or group).", "description": "Executes TEAL program(s) in context and returns debugging information about the execution. This endpoint is only enabled when a node's configuration file sets EnableDeveloperAPI to true.", diff --git a/specs/kmd.oas3.json b/specs/kmd.oas3.json index c6a3e33..ee16681 100644 --- a/specs/kmd.oas3.json +++ b/specs/kmd.oas3.json @@ -39,7 +39,10 @@ "description": "Unknown Error", "content": {} } - } + }, + "tags": [ + "skip" + ] } }, "/v1/key": {