Exchange
suibets
Severity
LOW
What Our Normalizer Expects
core/src/exchanges/suibets/fetcher.ts declares SuibetsRawOffer.id as string:
// fetcher.ts — SuibetsRawOffer
id: string;
The normalizer uses raw.id as a string identifier (e.g. in ID construction and deduplication).
What The Live API Returns
The live GET https://www.suibets.com/api/p2p/offers response returns id as an integer, not a string:
[].id: int ← integer (interface expects string)
Endpoint tested: GET https://www.suibets.com/api/p2p/offers?status=all
Impact
LOW: JavaScript silently coerces integers to strings at template-literal and string-concatenation boundaries, so no immediate crash occurs. However:
- The TypeScript interface misrepresents the actual type, misleading developers
- Any code path calling string-only methods on
raw.id before coercion (.toLowerCase(), .split(), .replace()) will throw TypeError: raw.id.toLowerCase is not a function
- If
raw.id is compared against a string-typed ID from another source after a JSON round-trip, identity lookups silently fail (integer 123 !== string "123" in strict equality)
Suggested Fix
Update the interface and coerce explicitly:
// fetcher.ts — SuibetsRawOffer
id: number; // was: string
// normalizer.ts — wherever raw.id is used as a string key
id: String(raw.id),
Found by automated response shape drift audit
Exchange
suibets
Severity
LOW
What Our Normalizer Expects
core/src/exchanges/suibets/fetcher.tsdeclaresSuibetsRawOffer.idasstring:The normalizer uses
raw.idas a string identifier (e.g. in ID construction and deduplication).What The Live API Returns
The live
GET https://www.suibets.com/api/p2p/offersresponse returnsidas an integer, not a string:Endpoint tested:
GET https://www.suibets.com/api/p2p/offers?status=allImpact
LOW: JavaScript silently coerces integers to strings at template-literal and string-concatenation boundaries, so no immediate crash occurs. However:
raw.idbefore coercion (.toLowerCase(),.split(),.replace()) will throwTypeError: raw.id.toLowerCase is not a functionraw.idis compared against a string-typed ID from another source after a JSON round-trip, identity lookups silently fail (integer123!== string"123"in strict equality)Suggested Fix
Update the interface and coerce explicitly:
Found by automated response shape drift audit