Skip to content

Commit

Permalink
Merge pull request blend-capital#132 from blend-capital/backstop-toke…
Browse files Browse the repository at this point in the history
…n-management

Backstop token management
  • Loading branch information
mootz12 authored May 22, 2024
2 parents ba2d52d + 75d7a11 commit aa27f54
Show file tree
Hide file tree
Showing 26 changed files with 1,569 additions and 912 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"lint": "next lint"
},
"dependencies": {
"@blend-capital/blend-sdk": "^1.0.3",
"@creit.tech/stellar-wallets-kit": "^0.8.1",
"@blend-capital/blend-sdk": "^1.1.0",
"@creit.tech/stellar-wallets-kit": "0.8.1",
"@emotion/react": "^11.9.3",
"@emotion/styled": "^11.9.3",
"@mui/icons-material": "^5.8.4",
Expand Down
75 changes: 0 additions & 75 deletions src/components/backstop/BackstopBalanceCard.tsx

This file was deleted.

16 changes: 12 additions & 4 deletions src/components/backstop/BackstopDepositAnvil.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { scaleInputToBigInt } from '../../utils/scval';
import { getErrorFromSim } from '../../utils/txSim';
import { AnvilAlert } from '../common/AnvilAlert';
import { InputBar } from '../common/InputBar';
import { InputButton } from '../common/InputButton';
import { OpaqueButton } from '../common/OpaqueButton';
import { PoolComponentProps } from '../common/PoolComponentProps';
import { Row } from '../common/Row';
Expand Down Expand Up @@ -118,11 +119,16 @@ export const BackstopDepositAnvil: React.FC<PoolComponentProps> = ({ poolId }) =
setToDeposit(v);
setLoadingEstimate(true);
}}
onSetMax={handleDepositMax}
palette={theme.palette.backstop}
sx={{ width: '100%' }}
isMaxDisabled={isMaxDisabled}
/>
>
<InputButton
palette={theme.palette.backstop}
onClick={handleDepositMax}
disabled={isMaxDisabled}
text="MAX"
/>
</InputBar>
{viewType !== ViewType.MOBILE && (
<OpaqueButton
onClick={() => handleSubmitTransaction(false)}
Expand All @@ -136,7 +142,9 @@ export const BackstopDepositAnvil: React.FC<PoolComponentProps> = ({ poolId }) =
</Box>
<Box sx={{ marginLeft: '12px', display: 'flex', flexDirection: 'column', gap: '12px' }}>
<Typography variant="h5" sx={{ color: theme.palette.text.secondary }}>
{`$${toBalance(Number(toDeposit ?? 0) * (backstopData?.lpTokenPrice ?? 1))}`}
{`$${toBalance(
Number(toDeposit ?? 0) * (backstopData?.backstopToken.lpTokenPrice ?? 1)
)}`}
</Typography>
{viewType === ViewType.MOBILE && (
<OpaqueButton
Expand Down
Loading

0 comments on commit aa27f54

Please sign in to comment.