CSI 1537 Changelly Integration - #376
Conversation
Integrated the API calls for the Swap Token functionality
Added a new method that downloads a JS object as a CSV file. It is used to download the swap transactions that took place.
In the Swap History panel, a drop down will list all the wallet that are available and selecting them will list only the transactions in that wallet
…on-flow-hooks_Arnab-Sen
| RECEIVE_TXN_CANCEL_FAILED = 'DS_OPTS_1507', | ||
| RECEIVE_TXN_UNKNOWN_ERROR = 'DS_MISC_5502', | ||
|
|
||
| SWAP_TXN_UNKNOWN_ERROR = 'TODO_1234', // TODO: add error code |
There was a problem hiding this comment.
Can you suggest me the code? Is there any format that we follow? What does the number at the end signify?
| { | ||
| tab: 10, // this is a dummy value for the Swap tab | ||
| route: Routes.swap.index //TODO: Update the route | ||
| }, |
There was a problem hiding this comment.
Add it at the 2nd last index of array and remove comments
There was a problem hiding this comment.
Also update the values of tab index
There was a problem hiding this comment.
The values of just this particular tab or the rest of the tabs as well?
| id={`simple-tabpanel-${index}`} | ||
| aria-labelledby={`simple-tab-${index}`} |
There was a problem hiding this comment.
Replace generic name for ID and label by actual name
| style={{ | ||
| width: '80%', | ||
| height: '88%', | ||
| position: 'absolute', | ||
| flexDirection: 'column', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| zIndex: 100, | ||
| display: 'flex' | ||
| }} |
| @@ -0,0 +1,161 @@ | |||
| import { CallReceived, ContentCopy } from '@mui/icons-material'; | |||
There was a problem hiding this comment.
I don't think we need a panels folder. It can just be swap/dialog swap/exchange etc
| ); | ||
| }; | ||
|
|
||
| export default function received() { |
There was a problem hiding this comment.
Use Pascal Case for Component naming
| { | ||
| <SwapDetailsForm | ||
| fromToken={fromToken} | ||
| setFromToken={setFromToken} | ||
| toToken={toToken} | ||
| setToToken={setToToken} | ||
| amountToSend={amountToSend} | ||
| setAmountToSend={setAmountToSend} | ||
| handleChangeAmountToSend={handleChangeAmountToSend} | ||
| classesForm={classes.form} | ||
| allWallets={allWallets} | ||
| amountToReceive={amountToReceive || '0'} | ||
| price={toToken?.price || 0} | ||
| toWallet={toWallet} | ||
| setToWallet={setToWallet} | ||
| fromWallet={fromWallet} | ||
| fromWalletCoinData={fromWalletCoinData} | ||
| toWalletCoinData={toWalletCoinData} | ||
| setFromWallet={setFromWallet} | ||
| /> | ||
| } |
| {showSwapDetailsVerifyDialog && ( | ||
| <VerifySwapDetailsDialog | ||
| open={showSwapDetailsVerifyDialog} | ||
| onClose={() => { | ||
| cancelSwapTransaction(); | ||
| setShowSwapDetailsVerifyDialog(false); | ||
| }} | ||
| amountToSend={amountToSend} | ||
| amountToReceive={amountToReceive} | ||
| networkFees={fees} | ||
| sourceCoinSlug={COINS[fromToken.coinId].abbr.toUpperCase()} | ||
| sourceCoinName={fromToken.coinId} | ||
| targetCoinSlug={COINS[toToken.coinId].abbr.toUpperCase()} | ||
| targetCoinName={toToken.coinId} | ||
| receiveAddress={receiveAddress} | ||
| receiveFlowStep={receiveFlowStep} | ||
| sendFlowStep={sendFlowStep} | ||
| /> | ||
| )} | ||
| {showSwapCompletedDialog && ( | ||
| <SwapCompletedDialog | ||
| open={showSwapCompletedDialog} | ||
| onClose={() => { | ||
| setSwapCompletedDialog(false); | ||
| }} | ||
| toTokenName={COINS[toToken.coinId]?.name} | ||
| transactionId={swapTransaction.changellyTxnId} | ||
| /> | ||
| )} |
There was a problem hiding this comment.
We don't need conditional rendering when we are passing the open prop
| @@ -0,0 +1,817 @@ | |||
| import { | |||
There was a problem hiding this comment.
This file it too large, try splitting it into different files
|
Task linked: CU-85zrh0zen Build swap transaction flow hooks |
No description provided.