-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSI 1537 Changelly Integration #376
base: staging
Are you sure you want to change the base?
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
@@ -68,6 +68,8 @@ export enum CysyncError { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a code here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it at the 2nd last index of array and remove comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also update the values of tab index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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' | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use classes
@@ -0,0 +1,161 @@ | |||
import { CallReceived, ContentCopy } from '@mui/icons-material'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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} | ||
/> | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove brackets
{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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file it too large, try splitting it into different files
Task linked: CU-85zrh0zen Build swap transaction flow hooks |
No description provided.