Skip to content

Conversation

@yushih
Copy link
Collaborator

@yushih yushih commented Nov 5, 2025

Note

Migrates to CExplorer pools API with new request/response mapping, adds network param across app, updates bias pool set, and fixes backend URL.

  • API:
    • Replace POST form call with GET to BACKEND_URL using query params; set BACKEND_URL to https://api-mainnet-stage.cexplorer.io/v1/pool/list.
    • Map new API response via transformData; change pools to Array<Pool> and provide world.saturation using SATURATION.
    • Add network arg to getPools/listBiasedPools and propagate; remove toPoolArray and listPools.
    • Update BIAS_POOL_IDS (enable EMURB, comment EMUR8).
  • UI:
    • Parse network from URL in App and pass through to Home/HomeRevamp calls to listBiasedPools.
  • Types:
    • Move UrlParams to src/types.js and update imports.

Written by Cursor Bugbot for commit 583bfc3. This will update automatically on new commits. Configure here.

@yushih yushih requested a review from vsubhuman November 5, 2025 09:36
.then((response) => {
const poolsResponse: ApiPoolsResponse = response.data;
return poolsResponse;
return transformData(poolsResponse);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Empty Pools Break Runtime Array Operations Across API

The error handler in getPools returns pools: {} (empty object) instead of pools: [] (empty array). Since the ApiPoolsResponse type specifies pools?: Array<Pool>, this type mismatch will cause runtime errors when the code tries to call array methods like .filter() on the pools property (e.g., at line 219 where biasedPoolsResponse.pools.filter(...) is called).

Fix in Cursor Fix in Web

saturation: pool.live_stake / SATURATION,
}
)) ?? [],
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Missing Pool Properties Break UI Sorting and UI

The transformData function creates Pool objects missing many required properties from the Pool type definition. Most critically, it's missing total_size, score, pool_pic, fullname, tax_computed, hist_bpe, hist_roa, last_rewards, position, and the color_* properties. The missing total_size property will break the pool size sorting feature in HomeRevamp.js (lines 112-115) since sorting by undefined values will result in NaN comparisons. Other missing properties may cause issues elsewhere in the UI.

Fix in Cursor Fix in Web

@vsubhuman
Copy link
Collaborator

Closing in favour of #203

@vsubhuman vsubhuman closed this Nov 11, 2025
@vsubhuman vsubhuman deleted the rotate-recommendation branch November 11, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants