Skip to content

Commit

Permalink
fix Banxa to allow legacy time key
Browse files Browse the repository at this point in the history
  • Loading branch information
paullinator committed Jul 2, 2020
1 parent 9133a1b commit b9711b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/banxa.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ async function fetchBanxa (swapFuncParams: SwapFuncParams) {
const filePath = `./cache/banxa/${fileName}`
const csvData = await csv().fromFile(filePath)
for (const order of csvData) {
const date = new Date(order['Completed At (UTC)'])
let date
if (order['UTC Time']) {
date = new Date(order['UTC Time'])
} else if (order['Completed At (UTC)']) {
date = new Date(order['Completed At (UTC)'])
} else {
continue
}
const timestamp = date.getTime() / 1000
const uniqueIdentifier = order['Order Id']
const ssTx: StandardTx = {
Expand Down

0 comments on commit b9711b9

Please sign in to comment.