mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2024-11-19 01:40:29 +01:00
LND Taproot Channel
This commit is contained in:
parent
53eb5f086b
commit
d478356076
@ -141,7 +141,11 @@ export const postChannel = (req, res, next) => {
|
||||
else if (req.body.trans_type === '2') {
|
||||
options.form.sat_per_byte = req.body.trans_type_value;
|
||||
}
|
||||
if (req.body.channel_type !== '') {
|
||||
options.form.channel_type = req.body.channel_type;
|
||||
}
|
||||
options.form = JSON.stringify(options.form);
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Channel Open Options', data: options.form });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Opened', data: body });
|
||||
res.status(201).json(body);
|
||||
|
1
frontend/636.0cbaa440d3e13b05.js
Normal file
1
frontend/636.0cbaa440d3e13b05.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -10,9 +10,9 @@
|
||||
<link i18n-rel="" rel="mask-icon" href="assets/images/favicon-light/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta i18n-content="" name="msapplication-TileColor" content="#da532c">
|
||||
<meta i18n-content="" name="theme-color" content="#ffffff">
|
||||
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:95%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.7bc5ffcb3b65f807.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.7bc5ffcb3b65f807.css"></noscript></head>
|
||||
<style>html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:95%}@media only screen and (max-width: 56.25em){html{font-size:90%}}@media only screen and (max-width: 37.5em){html{font-size:80%}}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}</style><link rel="stylesheet" href="styles.a129e1d501647e70.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a129e1d501647e70.css"></noscript></head>
|
||||
<body>
|
||||
<rtl-app></rtl-app>
|
||||
<script src="runtime.4a54aecb0b8a9e1b.js" type="module"></script><script src="polyfills.aa01d8f6b94657cb.js" type="module"></script><script src="main.c5564c81d78ecdc2.js" type="module"></script>
|
||||
<script src="runtime.e59265aa5d4f55d6.js" type="module"></script><script src="polyfills.aa01d8f6b94657cb.js" type="module"></script><script src="main.726deac29ce5c56c.js" type="module"></script>
|
||||
|
||||
</body></html>
|
1
frontend/main.726deac29ce5c56c.js
Normal file
1
frontend/main.726deac29ce5c56c.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
(()=>{"use strict";var e,v={},m={};function r(e){var o=m[e];if(void 0!==o)return o.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(o,t,i,f)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,f]=e[n],c=!0,l=0;l<t.length;l++)(!1&f||a>=f)&&Object.keys(r.O).every(b=>r.O[b](t[l]))?t.splice(l--,1):(c=!1,f<a&&(a=f));if(c){e.splice(n--,1);var d=i();void 0!==d&&(o=d)}}return o}f=f||0;for(var n=e.length;n>0&&e[n-1][2]>f;n--)e[n]=e[n-1];e[n]=[t,i,f]},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((o,t)=>(r.f[t](e,o),o),[])),r.u=e=>e+"."+{167:"08268ac8336448ff",267:"3050ada6a6d9afd8",315:"25112d0bface4bf2",636:"608e564c7da96d80"}[e]+".js",r.miniCssF=e=>{},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="RTLApp:";r.l=(t,i,f,n)=>{if(e[t])e[t].push(i);else{var a,c;if(void 0!==f)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==o+f){a=u;break}}a||(c=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",o+f),a.src=r.tu(t)),e[t]=[i];var s=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:o=>o},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,f)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)f.push(n[2]);else if(666!=i){var a=new Promise((u,s)=>n=e[i]=[u,s]);f.push(n[2]=a);var c=r.p+r.u(i),l=new Error;r.l(c,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var s=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;l.message="Loading chunk "+i+" failed.\n("+s+": "+p+")",l.name="ChunkLoadError",l.type=s,l.request=p,n[1](l)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var o=(i,f)=>{var l,d,[n,a,c]=f,u=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(c)var s=c(r)}for(i&&i(f);u<n.length;u++)r.o(e,d=n[u])&&e[d]&&e[d][0](),e[d]=0;return r.O(s)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})()})();
|
||||
(()=>{"use strict";var e,v={},m={};function r(e){var o=m[e];if(void 0!==o)return o.exports;var t=m[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(o,t,i,f)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,f]=e[n],c=!0,l=0;l<t.length;l++)(!1&f||a>=f)&&Object.keys(r.O).every(b=>r.O[b](t[l]))?t.splice(l--,1):(c=!1,f<a&&(a=f));if(c){e.splice(n--,1);var d=i();void 0!==d&&(o=d)}}return o}f=f||0;for(var n=e.length;n>0&&e[n-1][2]>f;n--)e[n]=e[n-1];e[n]=[t,i,f]},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((o,t)=>(r.f[t](e,o),o),[])),r.u=e=>e+"."+{167:"08268ac8336448ff",267:"3050ada6a6d9afd8",315:"25112d0bface4bf2",636:"0cbaa440d3e13b05"}[e]+".js",r.miniCssF=e=>{},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={},o="RTLApp:";r.l=(t,i,f,n)=>{if(e[t])e[t].push(i);else{var a,c;if(void 0!==f)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==o+f){a=u;break}}a||(c=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",o+f),a.src=r.tu(t)),e[t]=[i];var s=(g,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(y=>y(b)),g)return g(b)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),c&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:o=>o},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(i,f)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)f.push(n[2]);else if(666!=i){var a=new Promise((u,s)=>n=e[i]=[u,s]);f.push(n[2]=a);var c=r.p+r.u(i),l=new Error;r.l(c,u=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var s=u&&("load"===u.type?"missing":u.type),p=u&&u.target&&u.target.src;l.message="Loading chunk "+i+" failed.\n("+s+": "+p+")",l.name="ChunkLoadError",l.type=s,l.request=p,n[1](l)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var o=(i,f)=>{var l,d,[n,a,c]=f,u=0;if(n.some(p=>0!==e[p])){for(l in a)r.o(a,l)&&(r.m[l]=a[l]);if(c)var s=c(r)}for(i&&i(f);u<n.length;u++)r.o(e,d=n[u])&&e[d]&&e[d][0](),e[d]=0;return r.O(s)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(o.bind(null,0)),t.push=o.bind(null,t.push.bind(t))})()})();
|
File diff suppressed because one or more lines are too long
1
frontend/styles.a129e1d501647e70.css
Normal file
1
frontend/styles.a129e1d501647e70.css
Normal file
File diff suppressed because one or more lines are too long
@ -140,7 +140,11 @@ export const postChannel = (req, res, next) => {
|
||||
} else if (req.body.trans_type === '2') {
|
||||
options.form.sat_per_byte = req.body.trans_type_value;
|
||||
}
|
||||
if (req.body.channel_type !== '') {
|
||||
options.form.channel_type = req.body.channel_type;
|
||||
}
|
||||
options.form = JSON.stringify(options.form);
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'DEBUG', fileName: 'Channels', msg: 'Channel Open Options', data: options.form });
|
||||
request.post(options).then((body) => {
|
||||
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Channels', msg: 'Channel Opened', data: body });
|
||||
res.status(201).json(body);
|
||||
|
@ -22,7 +22,7 @@ import { CommonService } from '../../../shared/services/common.service';
|
||||
export class OnChainReceiveComponent implements OnInit, OnDestroy {
|
||||
|
||||
public addressTypes = <any>[];
|
||||
public selectedAddressType: AddressType = ADDRESS_TYPES[0];
|
||||
public selectedAddressType: AddressType = ADDRESS_TYPES[2];
|
||||
public newAddress = '';
|
||||
public flgVersionCompatible = true;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
|
||||
|
@ -56,8 +56,11 @@
|
||||
</mat-form-field>
|
||||
</div>
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center">
|
||||
<div *ngIf="isTaprootAvailable" fxFlex="50" fxLayoutAlign="start center">
|
||||
<mat-slide-toggle tabindex="6" color="primary" name="taprootChannel" [(ngModel)]="taprootChannel">Taproot Channel</mat-slide-toggle>
|
||||
</div>
|
||||
<div fxFlex="50" fxLayoutAlign="start center">
|
||||
<mat-slide-toggle tabindex="6" color="primary" name="spendUnconfirmed" [(ngModel)]="spendUnconfirmed">Spend Unconfirmed Output</mat-slide-toggle>
|
||||
<mat-slide-toggle tabindex="7" color="primary" name="spendUnconfirmed" [(ngModel)]="spendUnconfirmed">Spend Unconfirmed Output</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,9 +3,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { mockCLEffects, mockECLEffects, mockLNDEffects, mockMatDialogRef, mockRTLEffects } from '../../../../shared/test-helpers/mock-services';
|
||||
import { mockCLEffects, mockECLEffects, mockLNDEffects, mockMatDialogRef, mockRTLEffects, mockDataService } from '../../../../shared/test-helpers/mock-services';
|
||||
import { SharedModule } from '../../../../shared/shared.module';
|
||||
import { RTLEffects } from '../../../../store/rtl.effects';
|
||||
import { CommonService } from '../../../../shared/services/common.service';
|
||||
import { DataService } from '../../../../shared/services/data.service';
|
||||
|
||||
import { RootReducer } from '../../../../store/rtl.reducers';
|
||||
import { LNDReducer } from '../../../../lnd/store/lnd.reducers';
|
||||
@ -27,9 +29,11 @@ describe('OpenChannelComponent', () => {
|
||||
EffectsModule.forRoot([mockRTLEffects, mockLNDEffects, mockCLEffects, mockECLEffects])
|
||||
],
|
||||
providers: [
|
||||
CommonService,
|
||||
{ provide: MatDialogRef, useClass: mockMatDialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { message: {} } },
|
||||
{ provide: RTLEffects, useClass: mockRTLEffects }
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { message: { information: {} } } },
|
||||
{ provide: RTLEffects, useClass: mockRTLEffects },
|
||||
{ provide: DataService, useClass: mockDataService }
|
||||
]
|
||||
}).
|
||||
compileComponents();
|
||||
|
@ -15,6 +15,7 @@ import { RTLState } from '../../../../store/rtl.state';
|
||||
import { saveNewChannel } from '../../../store/lnd.actions';
|
||||
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
|
||||
import { lndNodeSettings } from '../../../store/lnd.selector';
|
||||
import { CommonService } from 'src/app/shared/services/common.service';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-open-channel',
|
||||
@ -41,12 +42,14 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
|
||||
public selectedPubkey = '';
|
||||
public isPrivate = false;
|
||||
public selTransType = '0';
|
||||
public isTaprootAvailable = false;
|
||||
public taprootChannel = false;
|
||||
public spendUnconfirmed = false;
|
||||
public transTypeValue = '';
|
||||
public transTypes = TRANS_TYPES;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<OpenChannelComponent>, @Inject(MAT_DIALOG_DATA) public data: OpenChannelAlert, private store: Store<RTLState>, private actions: Actions) { }
|
||||
constructor(public dialogRef: MatDialogRef<OpenChannelComponent>, @Inject(MAT_DIALOG_DATA) public data: OpenChannelAlert, private store: Store<RTLState>, private actions: Actions, private commonService: CommonService) { }
|
||||
|
||||
ngOnInit() {
|
||||
if (this.data.message) {
|
||||
@ -54,11 +57,13 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
|
||||
this.totalBalance = this.data.message.balance;
|
||||
this.peer = this.data.message.peer || null;
|
||||
this.peers = this.data.message.peers || [];
|
||||
this.isTaprootAvailable = this.commonService.isVersionCompatible(this.information.version, '0.17.0');
|
||||
} else {
|
||||
this.information = {};
|
||||
this.totalBalance = 0;
|
||||
this.peer = null;
|
||||
this.peers = [];
|
||||
this.isTaprootAvailable = false;
|
||||
}
|
||||
this.alertTitle = this.data.alertTitle || 'Alert';
|
||||
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).
|
||||
@ -123,6 +128,7 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
|
||||
this.selectedPeer.setValue('');
|
||||
this.fundingAmount = null;
|
||||
this.isPrivate = !!this.selNode?.unannouncedChannels;
|
||||
this.taprootChannel = false;
|
||||
this.spendUnconfirmed = false;
|
||||
this.selTransType = '0';
|
||||
this.transTypeValue = '';
|
||||
@ -138,7 +144,7 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
|
||||
this.store.dispatch(saveNewChannel({
|
||||
payload: {
|
||||
selectedPeerPubkey: ((!this.peer || !this.peer.pub_key) ? this.selectedPubkey : this.peer.pub_key), fundingAmount: this.fundingAmount, private: this.isPrivate,
|
||||
transType: this.selTransType, transTypeValue: this.transTypeValue, spendUnconfirmed: this.spendUnconfirmed
|
||||
transType: this.selTransType, transTypeValue: this.transTypeValue, spendUnconfirmed: this.spendUnconfirmed, channelType: (this.taprootChannel ? 'taproot' : '')
|
||||
}
|
||||
}));
|
||||
}
|
||||
@ -147,7 +153,7 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
|
||||
if (isClosed) {
|
||||
this.advancedTitle = 'Advanced Options | ' + (this.selTransType === '1' ? 'Target Confirmation Blocks: ' : this.selTransType === '2' ?
|
||||
'Fee (Sats/vByte): ' : 'Default') + ((this.selTransType === '1' || this.selTransType === '2') ? this.transTypeValue : '') +
|
||||
' | Spend Unconfirmed Output: ' + (this.spendUnconfirmed ? 'Yes' : 'No');
|
||||
' | Taproot Channel: ' + (this.taprootChannel ? 'Yes' : 'No') + ' | Spend Unconfirmed Output: ' + (this.spendUnconfirmed ? 'Yes' : 'No');
|
||||
} else {
|
||||
this.advancedTitle = 'Advanced Options';
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center" class="mt-1">
|
||||
<mat-form-field fxLayout="column" fxFlex="30" fxLayoutAlign="start end">
|
||||
<mat-form-field fxLayout="column" fxFlex="50" fxLayoutAlign="start end">
|
||||
<mat-label>Transaction Type</mat-label>
|
||||
<mat-select tabindex="3" formControlName="selTransType">
|
||||
<mat-option *ngFor="let transType of transTypes" [value]="transType.id">
|
||||
@ -53,12 +53,17 @@
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxLayout="column" fxFlex="30">
|
||||
<mat-form-field fxLayout="column" fxFlex="50">
|
||||
<mat-label>{{channelFormGroup.controls.selTransType.value === '0' ? 'Default' : channelFormGroup.controls.selTransType.value === '1' ? 'Target Confirmation Blocks' : 'Fee (Sats/vByte)'}}</mat-label>
|
||||
<input matInput formControlName="transTypeValue" type="number" name="transTypeValue" tabindex="4" [step]="1" [required]="channelFormGroup.controls.selTransType.value !== '0'">
|
||||
<mat-error *ngIf="channelFormGroup.controls.transTypeValue.errors?.required">{{channelFormGroup.controls.selTransType.value === '0' ? 'Default' : channelFormGroup.controls.selTransType.value === '1' ? 'Target Confirmation Blocks' : 'Fee (Sats/vByte)'}} is required.</mat-error>
|
||||
</mat-form-field>
|
||||
<div fxFlex="35" fxLayoutAlign="start center">
|
||||
</div>
|
||||
<div fxLayout="row" fxFlex="100" fxLayoutAlign="space-between center" class="mt-1">
|
||||
<div *ngIf="isTaprootAvailable" fxFlex="50" fxLayoutAlign="start center">
|
||||
<mat-slide-toggle class="ps-2" tabindex="6" color="primary" formControlName="taprootChannel" name="taprootChannel">Taproot Channel</mat-slide-toggle>
|
||||
</div>
|
||||
<div fxFlex="50" fxLayoutAlign="start center">
|
||||
<mat-slide-toggle tabindex="6" color="primary" formControlName="spendUnconfirmed" name="spendUnconfirmed">Spend Unconfirmed Output</mat-slide-toggle>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,9 +7,11 @@ import { LNDReducer } from '../../../lnd/store/lnd.reducers';
|
||||
import { CLNReducer } from '../../../cln/store/cln.reducers';
|
||||
import { ECLReducer } from '../../../eclair/store/ecl.reducers';
|
||||
import { LoggerService } from '../../../shared/services/logger.service';
|
||||
import { CommonService } from '../../../shared/services/common.service';
|
||||
import { DataService } from '../../../shared/services/data.service';
|
||||
|
||||
import { ConnectPeerComponent } from './connect-peer.component';
|
||||
import { mockCLEffects, mockECLEffects, mockLNDEffects, mockMatDialogRef, mockRTLEffects } from '../../../shared/test-helpers/mock-services';
|
||||
import { mockCLEffects, mockECLEffects, mockLNDEffects, mockMatDialogRef, mockRTLEffects, mockDataService } from '../../../shared/test-helpers/mock-services';
|
||||
import { LNDEffects } from '../../store/lnd.effects';
|
||||
import { SharedModule } from '../../../shared/shared.module';
|
||||
import { EffectsModule } from '@ngrx/effects';
|
||||
@ -29,10 +31,11 @@ describe('ConnectPeerComponent', () => {
|
||||
EffectsModule.forRoot([mockRTLEffects, mockLNDEffects, mockCLEffects, mockECLEffects])
|
||||
],
|
||||
providers: [
|
||||
LoggerService,
|
||||
CommonService, LoggerService,
|
||||
{ provide: MatDialogRef, useClass: mockMatDialogRef },
|
||||
{ provide: MAT_DIALOG_DATA, useValue: { message: {} } },
|
||||
{ provide: LNDEffects, useClass: mockLNDEffects }
|
||||
{ provide: LNDEffects, useClass: mockLNDEffects },
|
||||
{ provide: DataService, useClass: mockDataService }
|
||||
]
|
||||
}).
|
||||
compileComponents();
|
||||
|
@ -9,15 +9,17 @@ import { MatStepper } from '@angular/material/stepper';
|
||||
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import { LoggerService } from '../../../shared/services/logger.service';
|
||||
import { Peer } from '../../../shared/models/lndModels';
|
||||
import { GetInfo, Peer } from '../../../shared/models/lndModels';
|
||||
import { OpenChannelAlert } from '../../../shared/models/alertData';
|
||||
import { APICallStatusEnum, LNDActions, TRANS_TYPES } from '../../../shared/services/consts-enums-functions';
|
||||
|
||||
import { LNDEffects } from '../../store/lnd.effects';
|
||||
import { RTLState } from '../../../store/rtl.state';
|
||||
import { fetchGraphNode, saveNewChannel, saveNewPeer } from '../../store/lnd.actions';
|
||||
import { lndNodeSettings } from '../../store/lnd.selector';
|
||||
import { nodeInfoAndNodeSettingsAndAPIStatus } from '../../store/lnd.selector';
|
||||
import { SelNodeChild } from '../../../shared/models/RTLconfig';
|
||||
import { CommonService } from 'src/app/shared/services/common.service';
|
||||
import { ApiCallStatusPayload } from 'src/app/shared/models/apiCallsPayload';
|
||||
|
||||
@Component({
|
||||
selector: 'rtl-connect-peer',
|
||||
@ -37,6 +39,7 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
|
||||
public channelOpenStatus = null;
|
||||
public newlyAddedPeer: Peer | null = null;
|
||||
public flgEditable = true;
|
||||
public isTaprootAvailable = false;
|
||||
public peerConnectionError = '';
|
||||
public channelConnectionError = '';
|
||||
public peerFormLabel = 'Peer Details';
|
||||
@ -46,7 +49,9 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
|
||||
statusFormGroup: UntypedFormGroup;
|
||||
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<ConnectPeerComponent>, @Inject(MAT_DIALOG_DATA) public data: OpenChannelAlert, private store: Store<RTLState>, private lndEffects: LNDEffects, private formBuilder: UntypedFormBuilder, private actions: Actions, private logger: LoggerService) { }
|
||||
constructor(public dialogRef: MatDialogRef<ConnectPeerComponent>, @Inject(MAT_DIALOG_DATA) public data: OpenChannelAlert,
|
||||
private store: Store<RTLState>, private lndEffects: LNDEffects, private formBuilder: UntypedFormBuilder,
|
||||
private actions: Actions, private logger: LoggerService, private commonService: CommonService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.totalBalance = this.data.message?.balance || 0;
|
||||
@ -60,14 +65,16 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
|
||||
isPrivate: [!!this.selNode?.unannouncedChannels],
|
||||
selTransType: [TRANS_TYPES[0].id],
|
||||
transTypeValue: [{ value: '', disabled: true }],
|
||||
taprootChannel: [false],
|
||||
spendUnconfirmed: [false],
|
||||
hiddenAmount: ['', [Validators.required]]
|
||||
});
|
||||
this.statusFormGroup = this.formBuilder.group({});
|
||||
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).
|
||||
subscribe((nodeSettings: SelNodeChild | null) => {
|
||||
this.selNode = nodeSettings;
|
||||
this.channelFormGroup.controls.isPrivate.setValue(!!nodeSettings?.unannouncedChannels);
|
||||
this.store.select(nodeInfoAndNodeSettingsAndAPIStatus).pipe(takeUntil(this.unSubs[0])).
|
||||
subscribe((infoSettingsStatusSelector: { information: GetInfo, nodeSettings: SelNodeChild | null, apiCallStatus: ApiCallStatusPayload }) => {
|
||||
this.selNode = infoSettingsStatusSelector.nodeSettings;
|
||||
this.channelFormGroup.controls.isPrivate.setValue(!!infoSettingsStatusSelector.nodeSettings?.unannouncedChannels);
|
||||
this.isTaprootAvailable = this.commonService.isVersionCompatible(infoSettingsStatusSelector.information.version, '0.17.0');
|
||||
});
|
||||
this.channelFormGroup.controls.selTransType.valueChanges.pipe(takeUntil(this.unSubs[1])).subscribe((transType) => {
|
||||
if (transType === TRANS_TYPES[0].id) {
|
||||
@ -141,7 +148,7 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
|
||||
this.store.dispatch(saveNewChannel({
|
||||
payload: {
|
||||
selectedPeerPubkey: this.newlyAddedPeer?.pub_key!, fundingAmount: this.channelFormGroup.controls.fundingAmount.value, private: this.channelFormGroup.controls.isPrivate.value,
|
||||
transType: this.channelFormGroup.controls.selTransType.value, transTypeValue: this.channelFormGroup.controls.transTypeValue.value, spendUnconfirmed: this.channelFormGroup.controls.spendUnconfirmed.value
|
||||
transType: this.channelFormGroup.controls.selTransType.value, transTypeValue: this.channelFormGroup.controls.transTypeValue.value, spendUnconfirmed: this.channelFormGroup.controls.spendUnconfirmed.value, channelType: (!!this.channelFormGroup.controls.taprootChannel.value ? 'taproot' : '')
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -285,7 +285,8 @@ export class LNDEffects implements OnDestroy {
|
||||
this.store.dispatch(updateLNDAPICallStatus({ payload: { action: 'SaveNewChannel', status: APICallStatusEnum.INITIATED } }));
|
||||
return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.CHANNELS_API, {
|
||||
node_pubkey: action.payload.selectedPeerPubkey, local_funding_amount: action.payload.fundingAmount, private: action.payload.private,
|
||||
trans_type: action.payload.transType, trans_type_value: action.payload.transTypeValue, spend_unconfirmed: action.payload.spendUnconfirmed
|
||||
trans_type: action.payload.transType, trans_type_value: action.payload.transTypeValue, spend_unconfirmed: action.payload.spendUnconfirmed,
|
||||
channel_type: action.payload.channelType
|
||||
}).pipe(
|
||||
map((postRes: any) => {
|
||||
this.logger.info(postRes);
|
||||
|
@ -527,6 +527,7 @@ export interface SaveChannel {
|
||||
transType: string;
|
||||
transTypeValue: string;
|
||||
spendUnconfirmed: boolean;
|
||||
channelType: string;
|
||||
}
|
||||
|
||||
export interface CloseChannel {
|
||||
|
@ -1003,6 +1003,10 @@ mat-card-content.mat-mdc-card-content:first-child {
|
||||
}
|
||||
}
|
||||
|
||||
.ps-2 {
|
||||
padding-left: ($gap*2.5) !important;
|
||||
}
|
||||
|
||||
.m-1px {
|
||||
margin: 1px !important;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user