-
Notifications
You must be signed in to change notification settings - Fork 8
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/lifi reporter #194
base: master
Are you sure you want to change the base?
Paul/lifi reporter #194
Conversation
6385945
to
027b1b5
Compare
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.
This can pass, but I'd rather have stricter IO by use of cleaners
const response = await fetch(`${url}/v1/integrators/edgeapp`) | ||
if (!response.ok) { | ||
const text = await response.text() | ||
throw new Error(text) |
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.
The error should include text for lookup
throw new Error(text) | ||
} | ||
|
||
const minAmount = Number(process.argv[2] ?? 100) |
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.
Use a cleaner to avoid NaN numbers
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.
asStringNumber
?
const result = await response.json() | ||
const integrators = asIntegrators(result) |
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 wonder why we don't use asJSON
more often?
const integrators = asIntegrators(result) | ||
let balUsd = 0 | ||
const tokenAddresses: { [chainId: string]: string[] } = {} | ||
console.log(JSON.stringify(integrators, null, 2)) |
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.
Is this console log for debugging?
console.log(JSON.stringify(integrators, null, 2)) | ||
integrators.feeBalances.forEach(fb => { | ||
fb.tokenBalances.forEach(tb => { | ||
const amount = Number(tb.amountUsd) |
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.
Hmm, why not use an asStringNumber?
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none