diff --git a/src/components/app-body/sweep/index.js b/src/components/app-body/sweep/index.js index 29c781e..b31dcc8 100644 --- a/src/components/app-body/sweep/index.js +++ b/src/components/app-body/sweep/index.js @@ -101,6 +101,32 @@ const SweepWif = (props) => { } } + const handleCancelCounterOffers = async () => { + try { + console.log(`Executing handleCancelCounterOffers()`) + + // Set modal initial state + // setShowModal(true) + // setHideSpinner(false) + // setStatusMsg('') + + // Get the keypair that holds Counter Offer UTXOs. + const bchDexLib = appData.dexLib + const keyPair = await bchDexLib.take.util.getKeyPair(1) + const wif = keyPair.wif + // console.log(`WIF: ${wif}`) + + // Sweep the private key holding the Counter Offer UTXOs. + setWifToSweep(wif) + + + + await handleSweep() + } catch (err) { + console.error('Error in handleCancelCounterOffers(): ', err) + } + } + // Modal component const getModal = () => ( setShowModal(false)}> @@ -178,6 +204,29 @@ const SweepWif = (props) => { + +
+
+
+ + + +

+ When a Buy order is created, the coins (UTXO) to pay for it are + moved to a secondary address. Clicking the button below will + sweep those funds back into this main wallet. This will also + cancel/invalidate all open Counter Offers that you've created. +

+ +
+ + + + + + {showModal && getModal()}