@@ -50,6 +50,12 @@ import {
50
50
FireFlyOperationFilter ,
51
51
FireFlyOperationResponse ,
52
52
FireFlyTokenTransferFilter ,
53
+ FireFlyContractInvokeResponse ,
54
+ FireFlyContractQueryResponse ,
55
+ FireFlyContractAPIInvokeRequest ,
56
+ FireFlyContractAPIQueryRequest ,
57
+ FireFlyContractInvokeRequest ,
58
+ FireFlyContractQueryRequest ,
53
59
} from './interfaces' ;
54
60
import { FireFlyWebSocket , FireFlyWebSocketCallback } from './websocket' ;
55
61
import HttpBase , { mapConfig } from './http' ;
@@ -318,6 +324,46 @@ export default class FireFly extends HttpBase {
318
324
return this . getOne < FireFlyContractAPIResponse > ( `/apis/${ name } ` , options ) ;
319
325
}
320
326
327
+ async invokeContract (
328
+ request : FireFlyContractInvokeRequest ,
329
+ options ?: FireFlyCreateOptions ,
330
+ ) : Promise < FireFlyContractInvokeResponse > {
331
+ return this . createOne < FireFlyContractInvokeResponse > ( '/contracts/invoke' , request , options ) ;
332
+ }
333
+
334
+ async queryContract (
335
+ request : FireFlyContractQueryRequest ,
336
+ options ?: FireFlyCreateOptions ,
337
+ ) : Promise < FireFlyContractQueryResponse > {
338
+ return this . createOne < FireFlyContractQueryResponse > ( '/contracts/query' , request , options ) ;
339
+ }
340
+
341
+ async invokeContractAPI (
342
+ apiName : string ,
343
+ methodPath : string ,
344
+ request : FireFlyContractAPIInvokeRequest ,
345
+ options ?: FireFlyCreateOptions ,
346
+ ) : Promise < FireFlyContractInvokeResponse > {
347
+ return this . createOne < FireFlyContractInvokeResponse > (
348
+ `/apis/${ apiName } /invoke/${ methodPath } ` ,
349
+ request ,
350
+ options ,
351
+ ) ;
352
+ }
353
+
354
+ async queryContractAPI (
355
+ apiName : string ,
356
+ methodPath : string ,
357
+ request : FireFlyContractAPIQueryRequest ,
358
+ options ?: FireFlyCreateOptions ,
359
+ ) : Promise < FireFlyContractQueryResponse > {
360
+ return this . createOne < FireFlyContractQueryResponse > (
361
+ `/apis/${ apiName } /query/${ methodPath } ` ,
362
+ request ,
363
+ options ,
364
+ ) ;
365
+ }
366
+
321
367
async createContractListener (
322
368
listener : FireFlyContractListenerRequest ,
323
369
options ?: FireFlyCreateOptions ,
0 commit comments