Skip to content

Commit 0617707

Browse files
committed
Rename event methods with a prefix "perform" #25
1 parent 373b48b commit 0617707

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

src/Interface.mjs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

tests/6-websocket-extern.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const { wsUrl } = getEnv( {
66
'path': '../../../.env',
77
'selection': [ [ 'wsUrl', 'SOLANA_TRACKER_DATASTREAM' ] ]
88
} )
9-
109

1110
const ws = new TrackerAPI( { wsUrl } )
1211
const a = [

0 commit comments

Comments
 (0)