-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Lighting Network support via Boltz submarine swaps (#482)
* Add Networks bottom sheet modal * Add screens and logic * rm comments + small fixes * Review fixes * Fix popup test * reverse submarine swap wip * Blind pset wip * wip * refactor into BoltzService class * refactor into BoltzService class * refactor into BoltzService class * refactor into BoltzService class * refactor * fix receiving address * fix boltz liquid api endpoint * Fix getInvoiceExpireDate() There's a bug on boltz mainnet api, where invoices DON'T include field `timeExpireDate`, resulting in invoices from mainnet to be considered expired. BoltzExchange/boltz-backend#437 This changes try to find out the correct expiration date cycling through different strategies and returning by default `Date.now() + 3,600,000` * fix bug on claim tx signing: wrong preimage * add working test * fix bug: using wrong brodcast tx function * add finalize * removes don't needed finalizer * new boltz testnet api endpoint * Removes DEFAULT_LIGHTNING_LIMITS Always query boltz api for swap limits Show spinner while querying boltz api for limits * throw error if invoice has no timestamp * removes nsequence and block height timeout * fix variable name * removes timeoutBlockHeight from makeClaimTransaction params: not needed anymore * fix error message * fix bug with claim transaction * fix success message after paying lightning invoice * update yarn.lock * update caniuse-lite * always show lbtc, fusd and usdt on list of assets * fix playwright test * change success message * removes modal unlock from receiving with LN * remove space before bang * fix alignment of SEND ALL button * fix bug where closing popup when entering lightning invoice and re-opening it would send user to liquid send * bug fix: on send don't open network modal for new_asset * calculate fee for claim tx * fix error when extracting axios error message * fix test error * warn user if he's spending too much with ln invoice * fix console error when history pushing for the same pathname * Several bug fixes and improvements: - validate all values in satoshis - show boltz fees right to invoice value - warning of low funds doesn't disable proceed button * show swap fees on new line * change 'Value' to 'Invoice value' * change invoice value unit from L-BTC to BTC * changes multiple of relay fee from 2 to 1.1 --------- Co-authored-by: João Bordalo <bordalix@users.noreply.github.com>
- Loading branch information
1 parent
7eb7f5a
commit 265a362
Showing
30 changed files
with
1,467 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import React, { useRef } from 'react'; | ||
import useOnClickOutside from '../hooks/use-onclick-outside'; | ||
|
||
interface Props { | ||
isOpen: boolean; | ||
onClose: () => any; | ||
onLightning: any; | ||
onLiquid: any; | ||
} | ||
|
||
const ModalSelectNetwork: React.FC<Props> = ({ isOpen, onClose, onLightning, onLiquid }) => { | ||
const ref = useRef<HTMLDivElement | null>(null); | ||
useOnClickOutside(ref, onClose); | ||
|
||
if (!isOpen) return <></>; | ||
|
||
return ( | ||
<div className="fixed bottom-0 z-50 flex"> | ||
<div className="min-h-60 p-8 m-auto bg-white rounded-t-lg shadow-md" ref={ref}> | ||
<div className="flex flex-col justify-between flex-1"> | ||
<h1 className="mb-4 text-lg">Select network</h1> | ||
<div className="flex justify-center"> | ||
<div className="h-15 p-2 cursor-pointer" onClick={onLiquid}> | ||
<img | ||
className="h-10 mt-0.5 block mx-auto mb-2" | ||
src="assets/images/networks/liquid.svg" | ||
alt="liquid network logo" | ||
/> | ||
<p className="text-xs">Liquid Network</p> | ||
</div> | ||
<div className="h-15 p-2 cursor-pointer" onClick={onLightning}> | ||
<img | ||
className="h-10 mt-0.5 block mx-auto mb-2" | ||
src="assets/images/networks/lightning.svg" | ||
alt="lightning network logo" | ||
/> | ||
<p className="text-xs">Lightning Network</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ModalSelectNetwork; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.