Skip to content

Commit

Permalink
fix min deposit stroops
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmagnus committed Dec 12, 2023
1 parent 1aa8c66 commit 353f6be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/core/pages/contracts-create/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ContractsCreate: React.FC = () => {
compoundType === 'Compound interest' ? compound : 0
),
yield_rate: BigInt(yieldRate),
min_deposit: BigInt(Number(data.min_deposit || 0)),
min_deposit: BigInt(Number(data.min_deposit || 0) * 10000000),
penalty_rate: BigInt(penaltyRate),
allowance_period: latestSequenceLedger + allowancePeriod,
signerSecret: vault.wallet.key.publicKey,
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/app/core/pages/contracts-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const ContractsDetail: React.FC = () => {

const loadContractData = useCallback(async (): Promise<void> => {
if (profile && contract) {
const wallet = profile.vault.wallet.key.publicKey
const wallet = profile.vault?.wallet.key.publicKey

let timeLeft = contractData?.timeLeft

Expand Down Expand Up @@ -189,6 +189,7 @@ export const ContractsDetail: React.FC = () => {
withdraw_amount: contractData?.position || 0,
contract_id: contract.id,
})
getHistory(contract.id).then(history => setHistory(history))
await getProfile()
toast({
title: 'Withdraw success!',
Expand Down Expand Up @@ -243,7 +244,7 @@ export const ContractsDetail: React.FC = () => {
onSubmitDeposit={onSubmitDeposit}
loading={loadingPosition}
contract={contract}
userAccount={profile?.vault.wallet.key.publicKey}
userAccount={profile?.vault?.wallet?.key.publicKey}
isDepositing={isDepositing}
isWithdrawing={isWithdrawing}
contractData={contractData}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const Deposit: React.FC<IDeposit> = ({
py="0.25rem"
alignItems="center"
gap="0.5rem"
stroke="black"
_dark={{ bg: 'black.800', color: 'white' }}
>
{contract?.asset?.image ? (
Expand Down

0 comments on commit 353f6be

Please sign in to comment.