File tree Expand file tree Collapse file tree 3 files changed +97
-2
lines changed Expand file tree Collapse file tree 3 files changed +97
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ export class BlockController {
78
78
public async broadcastTransaction (
79
79
@Body ( ) transaction : string ,
80
80
@Res ( ) err : TsoaResponse < 400 , { reason : string } > ,
81
- ) {
81
+ ) : Promise < { accepted : boolean ; broadcasted : boolean ; hash : string } > {
82
82
const rpcClient = await ifClient . getClient ( ) ;
83
83
const response = await rpcClient . chain . broadcastTransaction ( {
84
84
transaction,
Original file line number Diff line number Diff line change @@ -132,6 +132,44 @@ export function RegisterRoutes(app: Router) {
132
132
} ,
133
133
) ;
134
134
// 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
135
173
app . post (
136
174
"/transaction" ,
137
175
...fetchMiddlewares < RequestHandler > ( BlockController ) ,
Original file line number Diff line number Diff line change 159
159
]
160
160
}
161
161
},
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
+ },
162
201
"/transaction" : {
163
202
"post" : {
164
203
"operationId" : " BroadcastTransaction" ,
167
206
"description" : " if the transaction was accepted, the hash of the transaction" ,
168
207
"content" : {
169
208
"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
+ }
171
228
}
172
229
}
173
230
},
You can’t perform that action at this time.
0 commit comments