@@ -107,11 +107,9 @@ class TrackerAPI extends EventEmitter {
107107 }
108108
109109
110- createSwap ( { params, privateKey, skipConfirmation= false } ) {
110+ performSwap ( { params, privateKey, skipConfirmation= false } ) {
111111 this . #validateModule( { 'key' : 'swap' } )
112112 const { id } = this . #getId( )
113-
114- // this.emit( 'swap', { 'status': 'function started', id, 'data': null } )
115113 this . #swap. getSwapQuote ( params , id )
116114 . then ( async ( quote ) => {
117115 const data = await this . #swap. postSwapTransaction ( { quote, privateKey, skipConfirmation } )
@@ -121,16 +119,21 @@ class TrackerAPI extends EventEmitter {
121119 console . log ( 'FINISHED' )
122120 this . emit ( 'swap' , { id, 'eventStatus' : 'getQuote' , quote } )
123121 return true
124- // this.emit( 'swap', { 'status': 'function finished', id, data } )
125122 } )
126123
127- /*
128- this.getSwapQuote( params, id )
129- .then( ( quote ) => {
130- return this.postSwapTransaction( { quote, privateKey, skipConfirmation } )
131- } )
132- .catch( ( e ) => { return { 'status': false, 'messages': [ e ] } } )
133- */
124+ return id
125+ }
126+
127+
128+ performBatchData ( { batch } ) {
129+ const a = Promise . all (
130+ batch
131+ . map ( async ( { route, params } ) => {
132+ const data = await this . getData ( { route, params } )
133+ return data
134+ } )
135+ )
136+
134137 return true
135138 }
136139
0 commit comments