diff --git a/src/actions/borrow.tsx b/src/actions/borrow.tsx index 0045551..195b04f 100644 --- a/src/actions/borrow.tsx +++ b/src/actions/borrow.tsx @@ -126,8 +126,6 @@ export const borrow = async ( ) : undefined; - - let amountLamports: number = 0; let fromLamports: number = 0; if (amountType === BorrowAmountType.LiquidityBorrowAmount) { @@ -154,7 +152,6 @@ export const borrow = async ( fromLamports = amountLamports; } - const fromAccount = ensureSplAccount( instructions, finalCleanupInstructions, @@ -197,7 +194,6 @@ export const borrow = async ( instructions = []; cleanupInstructions = [...finalCleanupInstructions]; - // create approval for transfer transactions const transferAuthority = approve( instructions, @@ -205,7 +201,7 @@ export const borrow = async ( fromAccount, wallet.publicKey, fromLamports, - false, + false ); signers.push(transferAuthority); diff --git a/src/components/BorrowInput/index.tsx b/src/components/BorrowInput/index.tsx index 744dbd4..0f411fa 100644 --- a/src/components/BorrowInput/index.tsx +++ b/src/components/BorrowInput/index.tsx @@ -205,7 +205,7 @@ export const BorrowInput = (props: { flexDirection: "row", justifyContent: "space-evenly", alignItems: "center", - marginBottom: 20 + marginBottom: 20, }} > { if (props.useWalletBalance) { - setBalance(tokenBalance) + setBalance(tokenBalance); } else { const id: string = cache @@ -77,26 +81,29 @@ export default function CollateralInput(props: { (reserve) => !onlyQuoteAllowed || reserve.info.liquidityMint.equals(market.info.quoteMint) - ) + ); - if(!collateralReserve && props.useFirstReserve && filteredReserveAccounts.length) { + if ( + !collateralReserve && + props.useFirstReserve && + filteredReserveAccounts.length + ) { const address = filteredReserveAccounts[0].pubkey.toBase58(); setCollateralReserve(address); } - const renderReserveAccounts = filteredReserveAccounts - .map((reserve) => { - const mint = reserve.info.liquidityMint.toBase58(); - const address = reserve.pubkey.toBase58(); - const name = getTokenName(tokenMap, mint); - return ( - - ); - }); + const renderReserveAccounts = filteredReserveAccounts.map((reserve) => { + const mint = reserve.info.liquidityMint.toBase58(); + const address = reserve.pubkey.toBase58(); + const name = getTokenName(tokenMap, mint); + return ( + + ); + }); return ( , parser?: AccountParser ) => { - if(obj.data.length === 0) { + if (obj.data.length === 0) { return; } diff --git a/src/models/account.ts b/src/models/account.ts index c9fa53d..022a077 100644 --- a/src/models/account.ts +++ b/src/models/account.ts @@ -39,7 +39,7 @@ export function approve( ) ); - if(autoRevoke) { + if (autoRevoke) { cleanupInstructions.push( Token.createRevokeInstruction(tokenProgram, account, owner, []) ); diff --git a/src/views/borrow/index.tsx b/src/views/borrow/index.tsx index e3f13a8..339fe7a 100644 --- a/src/views/borrow/index.tsx +++ b/src/views/borrow/index.tsx @@ -18,7 +18,11 @@ export const BorrowView = () => {
{reserveAccounts.map((account) => ( - + ))}
diff --git a/src/views/dashboard/deposit/index.tsx b/src/views/dashboard/deposit/index.tsx index cdb590d..8b49430 100644 --- a/src/views/dashboard/deposit/index.tsx +++ b/src/views/dashboard/deposit/index.tsx @@ -33,7 +33,10 @@ export const DashboardDeposits = () => {
{userDeposits.map((deposit) => ( - + ))} ); diff --git a/src/views/dashboard/index.tsx b/src/views/dashboard/index.tsx index bdac203..a2236f0 100644 --- a/src/views/dashboard/index.tsx +++ b/src/views/dashboard/index.tsx @@ -23,9 +23,7 @@ export const DashboardView = () => { /> {LABELS.DASHBOARD_INFO} - ): - userDeposits.length === 0 && userObligations.length === 0 ? - ( + ) : userDeposits.length === 0 && userObligations.length === 0 ? (
{ /> {LABELS.NO_LOANS_NO_DEPOSITS}
- ): ( + ) : ( - {userDeposits.length > 0 ? - : - {LABELS.NO_DEPOSITS} } + {userDeposits.length > 0 ? ( + + ) : ( + {LABELS.NO_DEPOSITS} + )} - {userObligations.length > 0 ? - : - {LABELS.NO_LOANS} } + {userObligations.length > 0 ? ( + + ) : ( + {LABELS.NO_LOANS} + )} )} diff --git a/src/views/dashboard/obligation/index.tsx b/src/views/dashboard/obligation/index.tsx index 3671df9..ce89ca0 100644 --- a/src/views/dashboard/obligation/index.tsx +++ b/src/views/dashboard/obligation/index.tsx @@ -35,9 +35,12 @@ export const DashboardObligations = () => {
{userObligations.map((item) => { - return ; + return ( + + ); })} ); diff --git a/src/views/deposit/view/index.tsx b/src/views/deposit/view/index.tsx index 63d746b..dfb8fc0 100644 --- a/src/views/deposit/view/index.tsx +++ b/src/views/deposit/view/index.tsx @@ -17,7 +17,11 @@ export const DepositView = () => {
{reserveAccounts.map((account) => ( - + ))}