Skip to content

Commit 453b296

Browse files
shaneauerbachcursoragentshane
authored
Exclude Arbitrum from defi_positions chain count and display (#125)
Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: shane <[email protected]>
1 parent 54c96b1 commit 453b296

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

snippets/supported-chains-accordion.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ export const SupportedChainsAccordion = () => {
6262

6363
var defiPositionsCount = 0;
6464
if (idxResponseData && idxResponseData.chains) {
65-
defiPositionsCount = idxResponseData.chains.length;
65+
// Count chains excluding Arbitrum (chain_id 42161)
66+
for (var j = 0; j < idxResponseData.chains.length; j++) {
67+
if (idxResponseData.chains[j].chain_id !== 42161) {
68+
defiPositionsCount++;
69+
}
70+
}
6671
}
6772

6873
setCounts({
@@ -86,7 +91,13 @@ export const SupportedChainsAccordion = () => {
8691
if (!idxData || !idxData.chains) {
8792
return <p>No data available</p>;
8893
}
89-
supportedChains = idxData.chains;
94+
// Filter out Arbitrum (chain_id 42161) for defi_positions
95+
for (var i = 0; i < idxData.chains.length; i++) {
96+
var chain = idxData.chains[i];
97+
if (chain.chain_id !== 42161) {
98+
supportedChains.push(chain);
99+
}
100+
}
90101
} else {
91102
if (!data || !data.chains) {
92103
return <p>No data available</p>;

snippets/supported-chains.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ export const SupportedChains = ({ endpoint, title }) => {
3939
}
4040
}
4141
} else {
42-
supportedChains = data.chains;
42+
// For defi_positions, filter out Arbitrum
43+
for (var i = 0; i < data.chains.length; i++) {
44+
var chain = data.chains[i];
45+
if (endpoint === 'defi_positions' && chain.chain_id === 42161) {
46+
continue; // Skip Arbitrum
47+
}
48+
supportedChains.push(chain);
49+
}
4350
}
4451

4552
var count = supportedChains.length;

0 commit comments

Comments
 (0)