Skip to content

Commit cd6926d

Browse files
committed
fix: stringify indexer return data
1 parent 3a016ad commit cd6926d

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/liquidation-sdk-viem/src/preLiquidation/positionGetters.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export async function getPreLiquidablePositions(
2020
method: "POST",
2121
body: JSON.stringify({ marketIds: whitelistedMarkets }),
2222
});
23-
const data = parseWithBigInt<PreLiquidationResponse>(await response.json());
23+
24+
const data: PreLiquidationResponse = parseWithBigInt<PreLiquidationResponse>(
25+
JSON.stringify(await response.json()),
26+
);
2427

2528
const marketsAssets = await apiSdk.getMarketsAssets({
2629
chainId,

packages/liquidation-sdk-viem/test/examples/preLiquidation.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,16 @@ describe("pre liquidation", () => {
366366
{
367367
marketId,
368368
address: preLiquidationAddress,
369-
preLiquidationParams: preLiquidationParams,
369+
preLiquidationParams: {
370+
...preLiquidationParams,
371+
preLltv: preLiquidationParams.preLltv.toString(),
372+
preLCF1: preLiquidationParams.preLCF1.toString(),
373+
preLCF2: preLiquidationParams.preLCF2.toString(),
374+
preLIF1: preLiquidationParams.preLIF1.toString(),
375+
preLIF2: preLiquidationParams.preLIF2.toString(),
376+
},
370377
enabledPositions: [borrower.address],
371-
price,
378+
price: price.toString(),
372379
},
373380
],
374381
});

0 commit comments

Comments
 (0)