Skip to content

Commit

Permalink
fix(coinmarket): fix kyc swap pending state
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeWall authored and tomasklim committed Dec 16, 2024
1 parent 221fe9e commit 0b11679
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,19 +535,20 @@ export const useCoinmarketExchangeForm = ({
return;
}

const selectedTrade = trade?.data || selectedQuote;
// sendAddress may be set by useCoinmarketWatchTrade hook to the trade object
const sendAddress = selectedQuote?.sendAddress || trade?.data?.sendAddress;
const sendAddress = selectedTrade?.sendAddress;
if (
selectedQuote &&
selectedQuote.orderId &&
selectedTrade &&
selectedTrade.orderId &&
sendAddress &&
selectedQuote.sendStringAmount
selectedTrade.sendStringAmount
) {
const sendStringAmount = shouldSendInSats
? amountToSmallestUnit(selectedQuote.sendStringAmount, decimals)
: selectedQuote.sendStringAmount;
? amountToSmallestUnit(selectedTrade.sendStringAmount, decimals)
: selectedTrade.sendStringAmount;
const sendPaymentExtraId =
selectedQuote.partnerPaymentExtraId || trade?.data?.partnerPaymentExtraId;
selectedTrade.partnerPaymentExtraId || trade?.data?.partnerPaymentExtraId;
const result = await recomposeAndSign({
account,
address: sendAddress,
Expand All @@ -559,12 +560,12 @@ export const useCoinmarketExchangeForm = ({
if (result?.success) {
dispatch(
coinmarketExchangeActions.saveTrade(
selectedQuote,
selectedTrade,
selectedAccount.account,
new Date().toISOString(),
),
);
dispatch(coinmarketExchangeActions.saveTransactionId(selectedQuote.orderId));
dispatch(coinmarketExchangeActions.saveTransactionId(selectedTrade.orderId));
navigateToExchangeDetail();
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion suite-common/wallet-config/src/networksConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ export const networks = {
customBackends: ['solana'],
accountTypes: {},
coingeckoId: undefined,
coingeckoNativeId: 'test-ripple', // fake, coingecko does not have testnets
coingeckoNativeId: undefined,
},
tada: {
// icarus derivation
Expand Down

0 comments on commit 0b11679

Please sign in to comment.