-
Notifications
You must be signed in to change notification settings - Fork 2k
Implement Backfill bitfinex with APIv2 & refactoring err.match function #276
Conversation
@@ -66,13 +66,22 @@ module.exports = function container (get, set, clear) { | |||
var opts = {product_id: product_id} | |||
if (mode === 'backward') { | |||
opts.to = marker.from | |||
// bitfinex v2 api required timestamp | |||
if (exchange_id === 'bitfinex' && !marker.from){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will really need to find a different solution for this, logic for exchanges should be limited to exchanges, and never live outside of that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
if opts.to is null , bitfinex response 1 years ago data.
hm.. I'm thinking..
exchange.getTrades(opts, function (err, trades) { | ||
var tradeFunc = 'getTrades' | ||
// for bitfinex v2 api for support historical api | ||
if (exchange_id === 'bitfinex'){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as before: this logic should happen in the exchange.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it..
function joinProduct (product_id) { | ||
return product_id.split('-')[0] + '' + product_id.split('-')[1] | ||
} | ||
|
||
// symbol for v2 | ||
function joinProduct2 (product_id) { | ||
return 't' + product_id.split('-')[0] + '' + product_id.split('-')[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just return 't' + joinProduct(product_id)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that. I forget to fix.
} | ||
if (opts.to) { | ||
// started point | ||
args.end = opts.to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the commands you are setting this to new Date().getTime()
, why not just do that here?
I also think there must be a nicer way than to use |
@nedievas is working for v2 |
fixed #257