Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run yarn build to fix Swagger types #85

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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