Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
xieqiancaosissi committed Dec 30, 2023
1 parent 53ff6cc commit bd6be3f
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 71 deletions.
106 changes: 42 additions & 64 deletions store/actions/repayFromDeposits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion store/actions/shadow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
],
});
Expand Down
13 changes: 7 additions & 6 deletions styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit bd6be3f

Please sign in to comment.