Skip to content

Commit 5eb8542

Browse files
authored
Run yarn build to fix Swagger types (#85)
1 parent 3017900 commit 5eb8542

File tree

3 files changed

+97
-2
lines changed

3 files changed

+97
-2
lines changed

src/controllers/block.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class BlockController {
7878
public async broadcastTransaction(
7979
@Body() transaction: string,
8080
@Res() err: TsoaResponse<400, { reason: string }>,
81-
) {
81+
): Promise<{ accepted: boolean; broadcasted: boolean; hash: string }> {
8282
const rpcClient = await ifClient.getClient();
8383
const response = await rpcClient.chain.broadcastTransaction({
8484
transaction,

src/routes/routes.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,44 @@ export function RegisterRoutes(app: Router) {
132132
},
133133
);
134134
// 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
135+
app.get(
136+
"/fee-rates",
137+
...fetchMiddlewares<RequestHandler>(BlockController),
138+
...fetchMiddlewares<RequestHandler>(BlockController.prototype.feeRates),
139+
140+
async function BlockController_feeRates(
141+
request: ExRequest,
142+
response: ExResponse,
143+
next: any,
144+
) {
145+
const args: Record<string, TsoaRoute.ParameterSchema> = {};
146+
147+
// 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
148+
149+
let validatedArgs: any[] = [];
150+
try {
151+
validatedArgs = templateService.getValidatedArgs({
152+
args,
153+
request,
154+
response,
155+
});
156+
157+
const controller = new BlockController();
158+
159+
await templateService.apiHandler({
160+
methodName: "feeRates",
161+
controller,
162+
response,
163+
next,
164+
validatedArgs,
165+
successStatus: undefined,
166+
});
167+
} catch (err) {
168+
return next(err);
169+
}
170+
},
171+
);
172+
// 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
135173
app.post(
136174
"/transaction",
137175
...fetchMiddlewares<RequestHandler>(BlockController),

src/swagger/swagger.json

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,45 @@
159159
]
160160
}
161161
},
162+
"/fee-rates": {
163+
"get": {
164+
"operationId": "FeeRates",
165+
"responses": {
166+
"200": {
167+
"description": "Ok",
168+
"content": {
169+
"application/json": {
170+
"schema": {
171+
"properties": {
172+
"fast": {
173+
"type": "string"
174+
},
175+
"average": {
176+
"type": "string"
177+
},
178+
"slow": {
179+
"type": "string"
180+
}
181+
},
182+
"required": [
183+
"fast",
184+
"average",
185+
"slow"
186+
],
187+
"type": "object"
188+
}
189+
}
190+
}
191+
}
192+
},
193+
"description": "Returns estimated fee rates for the network.",
194+
"tags": [
195+
"Block Controller"
196+
],
197+
"security": [],
198+
"parameters": []
199+
}
200+
},
162201
"/transaction": {
163202
"post": {
164203
"operationId": "BroadcastTransaction",
@@ -167,7 +206,25 @@
167206
"description": "if the transaction was accepted, the hash of the transaction",
168207
"content": {
169208
"application/json": {
170-
"schema": {}
209+
"schema": {
210+
"properties": {
211+
"hash": {
212+
"type": "string"
213+
},
214+
"broadcasted": {
215+
"type": "boolean"
216+
},
217+
"accepted": {
218+
"type": "boolean"
219+
}
220+
},
221+
"required": [
222+
"hash",
223+
"broadcasted",
224+
"accepted"
225+
],
226+
"type": "object"
227+
}
171228
}
172229
}
173230
},

0 commit comments

Comments
 (0)