Exchange
suibets
Drift Type
CHANGED_RESPONSE (residual from partial fix)
Severity
MEDIUM — string methods called on id (e.g. .replace(), .includes()) will throw a TypeError at runtime when the API returns a numeric id
Their Docs
Suibets P2P API returns id as a number (not a string) for offers — per the live API change tracked in #1868.
Our Cached Spec
No core/specs/suibets/ YAML exists. core/src/exchanges/suibets/api.ts is a documentation-only file (NOT wired into defineImplicitApi()).
Current State (discovered by code audit, 2026-08-23)
Issue #1868 was partially fixed: isSuibetsRawOffer() in fetcher.ts lines 64–72 now accepts both string and number for id:
return (
(typeof v['id'] === 'string' || typeof v['id'] === 'number') &&
typeof v['creatorOdds'] === 'number' &&
typeof v['creatorStake'] === 'number'
);
However, the SuibetsRawOffer interface at fetcher.ts:6 still declares:
This type inconsistency means:
- The type guard admits number ids at runtime (correct behaviour)
- But
raw.id downstream is still typed as string — TypeScript sees it as string
- Any code calling
raw.id.replace(...), raw.id.slice(...), or other string methods will receive a TypeError at runtime when id is a number, without any compile-time warning
callApi() References at Risk
None — suibets fetcher uses no callApi().
Hardcoded URL Bypasses
All Suibets HTTP calls use this.get<T>() → ctx.http.get() directly.
Impact
Fix Required
Update fetcher.ts line ~6: change id: string to id: string | number in the SuibetsRawOffer interface.
Found by automated spec drift audit — 2026-08-23
Exchange
suibets
Drift Type
CHANGED_RESPONSE (residual from partial fix)
Severity
MEDIUM — string methods called on
id(e.g..replace(),.includes()) will throw a TypeError at runtime when the API returns a numeric idTheir Docs
Suibets P2P API returns
idas a number (not a string) for offers — per the live API change tracked in #1868.Our Cached Spec
No
core/specs/suibets/YAML exists.core/src/exchanges/suibets/api.tsis a documentation-only file (NOT wired intodefineImplicitApi()).Current State (discovered by code audit, 2026-08-23)
Issue #1868 was partially fixed:
isSuibetsRawOffer()infetcher.tslines 64–72 now accepts bothstringandnumberforid:However, the
SuibetsRawOfferinterface atfetcher.ts:6still declares:id: stringThis type inconsistency means:
raw.iddownstream is still typed asstring— TypeScript sees it asstringraw.id.replace(...),raw.id.slice(...), or other string methods will receive a TypeError at runtime whenidis a number, without any compile-time warningcallApi() References at Risk
None — suibets fetcher uses no callApi().
Hardcoded URL Bypasses
All Suibets HTTP calls use
this.get<T>()→ctx.http.get()directly.Impact
idis always a string and may apply string operations to itraw.idis used as a string downstreamSuibetsRawOfferinterface must be updated toid: string | numberFix Required
Update
fetcher.tsline ~6: changeid: stringtoid: string | numberin theSuibetsRawOfferinterface.Found by automated spec drift audit — 2026-08-23