Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paul/fixes #192

Merged
merged 3 commits into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/partners/changenow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export const queryChangeNow = async (
const result = await response.json()
const txs = asChangeNowResult(result).exchanges

if (txs.length === 0) {
break
}
for (const rawTx of txs) {
let tx: ChangeNowTx
try {
Expand Down Expand Up @@ -130,11 +133,8 @@ export const queryChangeNow = async (
latestIsoDate = ssTx.isoDate
}
}
datelog(`ChangeNow latestIsoDate ${latestIsoDate}`)
offset += LIMIT
if (txs.length < LIMIT) {
break
}
datelog(`ChangeNow offset ${offset} latestIsoDate ${latestIsoDate}`)
offset += txs.length
retry = 0
} catch (e) {
datelog(e)
Expand Down
2 changes: 1 addition & 1 deletion src/partners/paybis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const QUERY_LIMIT_TXS = 50
* How far to rollback from the last successful query
* date when starting a new query
*/
const QUERY_LOOKBACK = 1000 * 60 * 60 * 24 * 30 // 30 days
const QUERY_LOOKBACK = 1000 * 60 * 60 * 24 * 7 // 30 days

/** Time period to query per loop */
const QUERY_TIME_BLOCK_MS = QUERY_LOOKBACK
Expand Down
7 changes: 7 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@ const CURRENCY_CONVERSION = {
AWCBEP20: 'AWC',
AWCBSC: 'AWC',
DAIMATIC: 'DAI',
ETHARB: 'ETH',
ETHOP: 'ETH',
ETHBASE: 'ETH',
GALAERC20: 'GALA',
WBTCMATIC: 'WBTC',
USDCERC20: 'USDC',
USDT20: 'USDT',
USDTERC20: 'USDT',
USDTPOLYGON: 'USDT',
USDCARB: 'USDC',
USDCPOLYGON: 'USDC',
USDCTRC20: 'USDC',
USDDTRC20: 'USDD',
USDTARB: 'USDT',
USDTSOL: 'USDT',
USDTTRC20: 'USDT',
ZADDR: 'ZEC',
BCHABC: 'BCH',
Expand Down
Loading