Skip to content

Commit

Permalink
Run yarn build to fix Swagger types (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
dguenther authored Sep 19, 2024
1 parent 3017900 commit 5eb8542
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/controllers/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class BlockController {
public async broadcastTransaction(
@Body() transaction: string,
@Res() err: TsoaResponse<400, { reason: string }>,
) {
): Promise<{ accepted: boolean; broadcasted: boolean; hash: string }> {
const rpcClient = await ifClient.getClient();
const response = await rpcClient.chain.broadcastTransaction({
transaction,
Expand Down
38 changes: 38 additions & 0 deletions src/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,44 @@ export function RegisterRoutes(app: Router) {
},
);
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.get(
"/fee-rates",
...fetchMiddlewares<RequestHandler>(BlockController),
...fetchMiddlewares<RequestHandler>(BlockController.prototype.feeRates),

async function BlockController_feeRates(
request: ExRequest,
response: ExResponse,
next: any,
) {
const args: Record<string, TsoaRoute.ParameterSchema> = {};

// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa

let validatedArgs: any[] = [];
try {
validatedArgs = templateService.getValidatedArgs({
args,
request,
response,
});

const controller = new BlockController();

await templateService.apiHandler({
methodName: "feeRates",
controller,
response,
next,
validatedArgs,
successStatus: undefined,
});
} catch (err) {
return next(err);
}
},
);
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
app.post(
"/transaction",
...fetchMiddlewares<RequestHandler>(BlockController),
Expand Down
59 changes: 58 additions & 1 deletion src/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,45 @@
]
}
},
"/fee-rates": {
"get": {
"operationId": "FeeRates",
"responses": {
"200": {
"description": "Ok",
"content": {
"application/json": {
"schema": {
"properties": {
"fast": {
"type": "string"
},
"average": {
"type": "string"
},
"slow": {
"type": "string"
}
},
"required": [
"fast",
"average",
"slow"
],
"type": "object"
}
}
}
}
},
"description": "Returns estimated fee rates for the network.",
"tags": [
"Block Controller"
],
"security": [],
"parameters": []
}
},
"/transaction": {
"post": {
"operationId": "BroadcastTransaction",
Expand All @@ -167,7 +206,25 @@
"description": "if the transaction was accepted, the hash of the transaction",
"content": {
"application/json": {
"schema": {}
"schema": {
"properties": {
"hash": {
"type": "string"
},
"broadcasted": {
"type": "boolean"
},
"accepted": {
"type": "boolean"
}
},
"required": [
"hash",
"broadcasted",
"accepted"
],
"type": "object"
}
}
}
},
Expand Down

0 comments on commit 5eb8542

Please sign in to comment.