Skip to content

Commit

Permalink
Merge pull request #1049 from AelinXYZ/staging
Browse files Browse the repository at this point in the history
merge staging to main
  • Loading branch information
alextheboredape authored Jun 16, 2023
2 parents 6ac374f + 37b5cc4 commit bd9f783
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/components/pools/PoolMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ const CardWithTitle = styled(BaseCardWithTitle)`
@media (min-width: ${({ theme }) => theme.themeBreakPoints.desktopStart}) {
order: 0;
}
padding-bottom: 20px;
`

const ActionsWrapper = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions src/components/pools/common/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export const WrapperGrid = styled.div`
display: grid;
grid-template-columns: 30px 1fr 30px;
}
padding: 0px 20px 20px 20px;
`

export const StepContents = styled.div`
Expand Down
1 change: 1 addition & 0 deletions src/components/toast/ToastComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const Text = styled.p`
color: ${({ theme: { colors } }) => colors.textColorLight};
font-size: 0.8rem;
margin: 5px 0;
overflow-wrap: anywhere;
`

export const ToastComponent = ({
Expand Down
12 changes: 10 additions & 2 deletions src/hooks/contracts/useTransaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default function useTransaction<
toast.dismiss()

const error = new TransactionError(
e.data?.message || e.message || 'Unable to decode revert reason',
e.error?.message ||
e.reason ||
e.data?.message ||
e.message ||
'Unable to decode revert reason',
e.data?.code || e.code,
e.data,
)
Expand All @@ -79,7 +83,11 @@ export default function useTransaction<
toast.dismiss()

const error = new TransactionError(
e.data?.message || e.message || 'Unable to decode revert reason',
e.error?.message ||
e.reason ||
e.data?.message ||
e.message ||
'Unable to decode revert reason',
e.data?.code || e.code,
e.data,
)
Expand Down
10 changes: 7 additions & 3 deletions src/utils/stake/getUniswapStakingRewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ export const getUniswapStakingRewards = async ({
const aelinRate = rates.aelin.usd
const ethRate = rates.ethereum.usd

/*
const uniswapData: UniswapResponse = await getUniswapPoolAmount()
const aelinInPool = uniswapData.pair.reserve0
const ethInPool = uniswapData.pair.reserve1
const uniV2TotalSupplyInWei = new Wei(BigNumber.from(uniV2TotalSupply), BASE_DECIMALS)
const totalStakedBalanceInWei = new Wei(BigNumber.from(totalStakedBalance), BASE_DECIMALS)
Expand All @@ -85,16 +87,18 @@ export const getUniswapStakingRewards = async ({
const uniV2ValueInContract = totalStakedBalanceInWei.toNumber() * uniV2Price
const rewardsValuePerYear = rewardForDurationInWei.toNumber() * yearProRata * aelinRate
*/

return {
decimals: decimals || BASE_DECIMALS,
symbol: symbol || '',
userRewards: userRewards || ZERO_BN,
userStake: userStake || ZERO_BN,
tokenBalance: tokenBalance || ZERO_BN,
ethInPool,
aelinInPool,
APY: (100 * rewardsValuePerYear) / uniV2ValueInContract,
// Temp fix til uniswap v2 subgraph work
ethInPool: '0',
aelinInPool: '0',
APY: 0, // (100 * rewardsValuePerYear) / uniV2ValueInContract,
}
} catch (error) {
console.error('error: ', error)
Expand Down

1 comment on commit bd9f783

@vercel
Copy link

@vercel vercel bot commented on bd9f783 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

aelin-ui-v2 – ./

aelin-ui-v2-git-main-aelin.vercel.app
aelin-ui-v2-aelin.vercel.app
app.aelin.xyz

Please sign in to comment.