Add routing budget and lnproxy (#328)

* Add advanced options to LN payout form

* Complete amount calcs

* Temporary working solution for lnproxy web only (uses text instead of json)

* Update LNpayment model and logics to use user's routing budget

* Add handle lnproxyserver networks (i2p, tor, clearnet) / (mainnet,testnet)

* Small fixes

* Small fixes
This commit is contained in:
Reckless_Satoshi 2022-11-24 17:47:49 +00:00 committed by GitHub
parent 86e6bed37c
commit acaf0db9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 7 deletions

View File

@ -25,7 +25,8 @@ import WalletsButton from '../WalletsButton';
import { LoadingButton } from '@mui/lab'; import { LoadingButton } from '@mui/lab';
import { pn } from '../../../utils'; import { pn } from '../../../utils';
import { ContentCopy, RoundaboutRight, Route, SelfImprovement } from '@mui/icons-material';
import { ContentCopy, Help, RoundaboutRight, Route, SelfImprovement } from '@mui/icons-material';
import { apiClient } from '../../../services/api'; import { apiClient } from '../../../services/api';
import lnproxies from '../../../../static/lnproxies.json'; import lnproxies from '../../../../static/lnproxies.json';
@ -385,7 +386,15 @@ export const LightningPayoutForm = ({
{t('Use Lnproxy')} {t('Use Lnproxy')}
</Typography> </Typography>
} }
/> />{' '}
<IconButton
component='a'
target='_blank'
href='https://www.lnproxy.org/about'
rel='noreferrer'
>
<Help sx={{ width: '0.9em', height: '0.9em', color: 'text.secondary' }} />
</IconButton>
</div> </div>
</Tooltip> </Tooltip>
</Grid> </Grid>
@ -487,7 +496,9 @@ export const LightningPayoutForm = ({
sx={{ height: '0.5em' }} sx={{ height: '0.5em' }}
onClick={() => onClick={() =>
systemClient.copyToClipboard( systemClient.copyToClipboard(
lightning.useLnproxy ? lightning.lnproxyAmount : lightning.amount, lightning.useLnproxy
? String(lightning.lnproxyAmount)
: String(lightning.amount),
) )
} }
> >
@ -543,7 +554,9 @@ export const LightningPayoutForm = ({
<LoadingButton <LoadingButton
loading={loadingLnproxy} loading={loadingLnproxy}
disabled={ disabled={
lightning.lnproxyInvoice.length < 20 || badLnproxyServer || lightning.badLnproxy lightning.lnproxyInvoice.length < 20 ||
badLnproxyServer != '' ||
lightning.badLnproxy
} }
onClick={fetchLnproxy} onClick={fetchLnproxy}
variant='outlined' variant='outlined'
@ -556,7 +569,7 @@ export const LightningPayoutForm = ({
)} )}
<LoadingButton <LoadingButton
loading={loading} loading={loading}
disabled={lightning.invoice == ''} disabled={lightning.invoice.length < 20 || lightning.badInvoice}
onClick={() => onClickSubmit(lightning.invoice)} onClick={() => onClickSubmit(lightning.invoice)}
variant='outlined' variant='outlined'
color='primary' color='primary'

View File

@ -1,8 +1,8 @@
[ [
{ {
"name": "↬ Lnproxy Dev", "name": "↬ Lnproxy Dev",
"mainnetClearnet": "lnproxy.org", "mainnetClearnet": "https://lnproxy.org",
"mainnetTOR": "rdq6tvulanl7aqtupmoboyk2z3suzkdwurejwyjyjf4itr3zhxrm2lad.onion", "mainnetTOR": "http://rdq6tvulanl7aqtupmoboyk2z3suzkdwurejwyjyjf4itr3zhxrm2lad.onion",
"mainnetI2P": "undefined", "mainnetI2P": "undefined",
"testnetClearnet": "undefined", "testnetClearnet": "undefined",
"testnetTOR": "undefined", "testnetTOR": "undefined",