Skip to content

Commit 8d3f4c1

Browse files
committed
fix: extra reward address check
1 parent cc4ce1f commit 8d3f4c1

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/gearboxRewards/api.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type PoolsWithExtraRewardsList = Record<NetworkType, Array<SupportedToken>>;
9898
const DEFAULT_POOLS_WITH_EXTRA_REWARDS: PoolsWithExtraRewardsList = {
9999
Mainnet: ["sdcrvUSDV3"],
100100
Arbitrum: [],
101-
Optimism: ["sdUSDCV3", "sdWETHV3"],
101+
Optimism: ["sdUSDC_eV3", "sdWETHV3"],
102102
Base: [],
103103
};
104104

@@ -197,16 +197,23 @@ export class GearboxRewardsApi {
197197
],
198198
}),
199199

200-
...tokenWithExtraRewards.map(symbol =>
201-
axios.get<MerkleXYZRewardsCampaignsResponse>(
200+
...tokenWithExtraRewards.map(symbol => {
201+
const addr = currentTokenData[symbol];
202+
203+
if (!addr)
204+
return (async () => {
205+
getAddress(addr);
206+
})();
207+
208+
return axios.get<MerkleXYZRewardsCampaignsResponse>(
202209
MerkleXYZApi.getRewardsCampaignsUrl({
203210
params: {
204211
chainId,
205-
mainParameter: getAddress(currentTokenData[symbol]),
212+
mainParameter: getAddress(addr),
206213
},
207214
}),
208-
),
209-
),
215+
);
216+
}),
210217
]);
211218

212219
const mcResponse =

0 commit comments

Comments
 (0)