diff --git a/store/actions/repayFromDeposits.ts b/store/actions/repayFromDeposits.ts index e0b33df6..a44e5009 100644 --- a/store/actions/repayFromDeposits.ts +++ b/store/actions/repayFromDeposits.ts @@ -37,72 +37,50 @@ export async function repayFromDeposits({ ); const transactions: Transaction[] = []; - if (!position || position === DEFAULT_POSITION) { - transactions.push({ - receiverId: oracleContract.contractId, - functionCalls: [ - { - methodName: ChangeMethodsOracle[ChangeMethodsOracle.oracle_call], - args: { - receiver_id: logicContract.contractId, - msg: JSON.stringify({ - Execute: { - actions: [ - ...(decreaseCollateralAmount.gt(0) - ? [ - { - DecreaseCollateral: { - token_id: tokenId, - amount: decreaseCollateralAmount.toFixed(0), - }, - }, - ] - : []), - { - Repay: { - token_id: tokenId, - amount: expandedAmount.mul(extraDecimalMultiplier).toFixed(0), - }, - }, - ], - }, - }), + const repayTemplate = + !position || position === DEFAULT_POSITION + ? { + Repay: { + token_id: tokenId, + amount: expandedAmount.mul(extraDecimalMultiplier).toFixed(0), }, - }, - ], - }); - } else { - transactions.push({ - receiverId: logicContract.contractId, - functionCalls: [ - { - methodName: ChangeMethodsLogic[ChangeMethodsLogic.execute], - args: { - actions: [ - ...(decreaseCollateralAmount.gt(0) - ? [ - { - DecreaseCollateral: { - token_id: tokenId, - amount: decreaseCollateralAmount.toFixed(0), - }, - }, - ] - : []), - { - PositionRepay: { - asset_amount: { - amount: expandedAmount.mul(extraDecimalMultiplier).toFixed(0), - token_id: tokenId, - }, - position, - }, - }, - ], + } + : { + PositionRepay: { + asset_amount: { + amount: expandedAmount.mul(extraDecimalMultiplier).toFixed(0), + token_id: tokenId, + }, + position, }, + }; + transactions.push({ + receiverId: oracleContract.contractId, + functionCalls: [ + { + methodName: ChangeMethodsOracle[ChangeMethodsOracle.oracle_call], + args: { + receiver_id: logicContract.contractId, + msg: JSON.stringify({ + Execute: { + actions: [ + ...(decreaseCollateralAmount.gt(0) + ? [ + { + DecreaseCollateral: { + token_id: tokenId, + amount: decreaseCollateralAmount.toFixed(0), + }, + }, + ] + : []), + repayTemplate, + ], + }, + }), }, - ], - }); - } + }, + ], + }); await prepareAndExecuteTransactions(transactions); } diff --git a/store/actions/shadow.ts b/store/actions/shadow.ts index 70cb69fe..4332b029 100644 --- a/store/actions/shadow.ts +++ b/store/actions/shadow.ts @@ -45,7 +45,7 @@ export async function shadow_action_supply({ ...(isMax ? {} : { amount: expandAmount }), msg: useAsCollateral ? JSON.stringify({ Execute: collateralActions }) : "", }, - attachedDeposit: new BN(expandToken(1, NEAR_DECIMALS)), + attachedDeposit: new BN(1), }, ], }); diff --git a/styles/global.css b/styles/global.css index faee5760..8942b632 100644 --- a/styles/global.css +++ b/styles/global.css @@ -778,19 +778,20 @@ options-list::-webkit-scrollbar { supported by Chrome, Edge, Opera and Firefox */ } -.health-tab{ +.health-tab { border-radius: 4px; } -.health-tab:hover, .health-tab-active{ - background: #2E304B; +.health-tab:hover, +.health-tab-active { + background: #2e304b; } -.health-tab .arrow-left{ +.health-tab .arrow-left { position: absolute; - right:100%; + right: 100%; width: 0; height: 0; border-top: 16px solid transparent; border-bottom: 15px solid transparent; - border-right:10px solid #2E304B; + border-right: 10px solid #2e304b; }