Skip to content

Commit 02797de

Browse files
committed
fixes
1 parent 4a320f9 commit 02797de

File tree

9 files changed

+339
-135
lines changed

9 files changed

+339
-135
lines changed

src/components/transactions/Repay/CollateralRepayActions.tsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@ export const CollateralRepayActions = ({
6464
protocolAction: ProtocolAction.repayCollateral,
6565
handleGetTxns: async (signature, deadline) => {
6666
const route = await buildTxFn();
67+
68+
console.log('paraswapRepayWithCollateral', {
69+
repayAllDebt,
70+
repayAmount,
71+
rateMode,
72+
repayWithAmount,
73+
74+
fromAssetData,
75+
poolReserve,
76+
symbol,
77+
isWrongNetwork,
78+
useFlashLoan,
79+
blocked,
80+
swapCallData: route.swapCallData,
81+
augustus: route.augustus,
82+
signature,
83+
deadline,
84+
signedAmount: calculateSignedAmount(repayWithAmount, fromAssetData.decimals),
85+
});
86+
6787
return paraswapRepayWithCollateral({
6888
repayAllDebt,
6989
repayAmount,
@@ -83,6 +103,25 @@ export const CollateralRepayActions = ({
83103
});
84104
},
85105
handleGetApprovalTxns: async () => {
106+
console.log('paraswapRepayWithCollateral', {
107+
repayAllDebt,
108+
repayAmount,
109+
rateMode,
110+
repayWithAmount,
111+
112+
fromAssetData,
113+
poolReserve,
114+
symbol,
115+
isWrongNetwork,
116+
useFlashLoan,
117+
blocked,
118+
swapCallData: '0x',
119+
augustus: API_ETH_MOCK_ADDRESS,
120+
signature: '0x',
121+
deadline: '0',
122+
signedAmount: calculateSignedAmount(repayWithAmount, fromAssetData.decimals),
123+
});
124+
86125
return paraswapRepayWithCollateral({
87126
repayAllDebt,
88127
repayAmount,

src/components/transactions/Repay/CollateralRepayModalContent.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ export function CollateralRepayModalContent({
257257
/>
258258
);
259259

260+
console.log('poolReserve', poolReserve.symbol, poolReserve.underlyingAsset);
261+
console.log(
262+
'collateralReserveData',
263+
collateralReserveData.symbol,
264+
collateralReserveData.underlyingAsset
265+
);
266+
260267
return (
261268
<>
262269
<AssetInput

src/components/transactions/Swap/actions/CollateralSwap/CollateralSwapActionsViaParaswapAdapters.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export const CollateralSwapActionsViaParaswapAdapters = ({
5959
if (!state.swapRate || !isParaswapRates(state.swapRate))
6060
throw new Error('Route required to build transaction');
6161

62+
setMainTxState({
63+
txHash: undefined,
64+
loading: true,
65+
});
6266
const isMaxSelected = state.isMaxSelected;
6367
const optimalRateData = state.swapRate.optimalRateData;
6468

@@ -186,7 +190,8 @@ export const CollateralSwapActionsViaParaswapAdapters = ({
186190
chainId: state.chainId,
187191
}
188192
);
189-
// TODO: fix success
193+
trackingHandlers.trackSwap(); // TODO: check this happening in all actions
194+
params.invalidateAppState(); // TODO: check this happening in all actions
190195
setMainTxState({
191196
txHash: response.hash,
192197
loading: false,

0 commit comments

Comments
 (0)