|
All checks were successful
deploy / deploy (push) Successful in 1m0s
Every quote evaluation was crashing with: SyntaxError: Cannot convert 6.034871047122912e+25 to a BigInt NEAR Intents quote amounts arrive as JS numbers that JSON.parse converts to scientific notation (e.g. 6.03e+25). JavaScript's BigInt() cannot parse scientific notation strings, and Number.toFixed(0) also returns scientific notation for numbers > 1e21. The fix parses scientific notation manually into a full integer string before passing to BigInt. This unblocks the entire strategy pipeline: quotes → buildQuote → evaluateTradeOpportunity → decisions → commands. Proof: bigintAmount(6.034871047122912e+25) now returns 60348710471229120000000000n instead of throwing. All 313 tests pass. Assumptions: Token amounts are integers represented in base units. Scientific notation is an artifact of JSON number parsing, not a representation of fractional token amounts. Precision beyond Number.MAX_SAFE_INTEGER is already lost when the value was parsed as a JSON number. Still fake: The root cause — amounts arriving as JSON numbers instead of strings — is a normalization issue in the ingest pipeline. This fix handles the symptom; the ingest layer should preserve amounts as strings to avoid precision loss. |
||
|---|---|---|
| .. | ||
| apps | ||
| bus/kafka | ||
| core | ||
| lib | ||
| observers | ||
| operator-dashboard/static | ||
| venues/near-intents | ||