Skip to content

Commit

Permalink
[web] Include tokenAmounts in KLAYswap single staking (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
junhoyeo authored Oct 12, 2022
1 parent a8df8e4 commit a542ef1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/bento-web/src/defi/klaytn/klayswap/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ export const getSinglePoolBalance = async (

const tokenInfo = getTokenInfo(pool.token);
const balance = Number(rawBalance) / 10 ** (tokenInfo?.decimals || 18);
let tokenAmounts: Record<string, number | undefined> | undefined = undefined;
if (tokenInfo) {
tokenAmounts = {
[tokenInfo.symbol]: balance,
};
}

return {
protocol: KlaytnDeFiProtocolType.KLAYSWAP,
Expand All @@ -75,6 +81,7 @@ export const getSinglePoolBalance = async (
tokens: [tokenInfo || null],
staked: {
lpAmount: balance,
tokenAmounts,
},
rewards: {
tokenAmounts: {
Expand Down

0 comments on commit a542ef1

Please sign in to comment.