Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
fix(pickle): Fix Jars without getRatio method (#3124)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpoulin authored Dec 11, 2023
1 parent cf44470 commit 81bf3af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/apps/pickle/common/pickle.jar.token-fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export abstract class PickleJarTokenFetcher extends AppTokenTemplatePositionFetc
}

async getPricePerShare({ contract }: GetPricePerShareParams<PickleJar, DefaultDataProps>) {
return contract.read.getRatio().then(v => [Number(v) / 10 ** 18]);
try {
const ratioRaw = await contract.read.getRatio();
return [Number(ratioRaw) / 10 ** 18];
} catch (error) {
return [1];
}
}

async getLiquidity({ appToken, contract }: GetDataPropsParams<PickleJar>) {
Expand Down

0 comments on commit 81bf3af

Please sign in to comment.