CLN Liquidity Ads Page Layout

pull/1127/head
ShahanaFarooqui 2 years ago
parent eafc7835f8
commit c0c9d798a1

File diff suppressed because one or more lines are too long

@ -23,8 +23,8 @@
<mat-error *ngIf="!channelAmount">Channel amount is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Opening Fee Rate (Sats/vByte)" name="channelOpeningFeeRate" [(ngModel)]="channelOpeningFeeRate" (keyup)="onCalculateOpeningFee()" type="number" step="10" tabindex="2" required>
<mat-error *ngIf="!channelOpeningFeeRate">Channel opening fee rate is required.</mat-error>
<input matInput placeholder="Channel Opening Fee Rate (Sats/vByte)" name="channel_opening_feeRate" [(ngModel)]="channel_opening_feeRate" (keyup)="onCalculateOpeningFee()" type="number" step="10" tabindex="2" required>
<mat-error *ngIf="!channel_opening_feeRate">Channel opening fee rate is required.</mat-error>
</mat-form-field>
</div>
</form>
@ -38,11 +38,11 @@
</span>
</div>
<mat-form-field fxFlex="34">
<input matInput placeholder="Node Capacity (Sats)" name="nodeCapacity" [(ngModel)]="nodeCapacity" (keyup)="onFilter()" tabindex="5" type="number" min="0" step="1000">
<mat-error *ngIf="!nodeCapacity">Node capacity is required.</mat-error>
<input matInput placeholder="Node Capacity (Sats)" name="node_capacity" [(ngModel)]="node_capacity" (keyup)="onFilter()" tabindex="5" type="number" min="0" step="1000">
<mat-error *ngIf="!node_capacity">Node capacity is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Count" name="channelCount" [(ngModel)]="channelCount" (keyup)="onFilter()" type="number" step="1" min="0" tabindex="6">
<input matInput placeholder="Channel Count" name="channel_count" [(ngModel)]="channel_count" (keyup)="onFilter()" type="number" step="1" min="0" tabindex="6">
</mat-form-field>
</div>
</form> -->
@ -62,38 +62,64 @@
<table mat-table #table [dataSource]="liquidityNodes" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
<ng-container matColumnDef="alias">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alias </th>
<td mat-cell *matCellDef="let lqNode" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '50rem'}" fxLayout="row" fxLayoutAlign="start center">
{{lqNode?.alias}}
<mat-chip-list class="ml-half" aria-label="Address Types">
<mat-chip *ngFor="let addrType of lqNode.address_types" color="primary" selected>
{{addrType === 'tor' ? 'Tor' : addrType === 'ipv' ? 'Clearnet' : addrType}}
</mat-chip>
</mat-chip-list>
<td mat-cell *matCellDef="let lqNode" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">
<span fxLayout="row" fxLayoutAlign="start center">
{{lqNode?.alias}}
<mat-chip-list class="ml-half" aria-label="Address Types">
<mat-chip *ngFor="let addrType of lqNode.address_types" color="primary" selected>
{{addrType === 'tor' ? 'Tor' : addrType === 'ipv' ? 'Clearnet' : addrType}}
</mat-chip>
</mat-chip-list>
</span>
</td>
</ng-container>
<ng-container matColumnDef="capacityChannels">
<th mat-header-cell *matHeaderCellDef> Capacity/Channels </th>
<td mat-cell *matCellDef="let lqNode">
{{lqNode?.nodeCapacity/100000000 | number:'1.0-2'}} BTC / {{lqNode?.channelCount | number:'1.0-0'}}
<ng-container matColumnDef="nodeid">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Node Id </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
<div class="ellipsis-parent" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '20rem'}">
<span class="ellipsis-child">{{lqNode?.nodeid}}</span>
</div>
</td>
</ng-container>
<ng-container matColumnDef="leaseFee">
<th mat-header-cell *matHeaderCellDef> Lease Fee </th>
<td mat-cell *matCellDef="let lqNode">
<ng-container matColumnDef="last_timestamp">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Last Announcement At </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">{{((lqNode?.last_timestamp * 1000) | date:'dd/MMM/y HH:mm') || '-'}}</td>
</ng-container>
<ng-container matColumnDef="compact_lease">
<th mat-header-cell *matHeaderCellDef mat-sort-header class="pl-1"> Compact Lease </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">{{ lqNode?.option_will_fund?.compact_lease }}</td>
</ng-container>
<!-- <ng-container matColumnDef="capacity_channels">
<th mat-header-cell *matHeaderCellDef class="pl-1"> Capacity/Channels </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
{{lqNode?.node_capacity/100000000 | number:'1.0-2'}} BTC / {{lqNode?.channel_count | number:'1.0-0'}}
</td>
</ng-container> -->
<ng-container matColumnDef="lease_fee">
<th mat-header-cell *matHeaderCellDef class="pl-1"> Lease Fee </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
{{lqNode?.option_will_fund?.lease_fee_base_msat/1000 | number:'1.0-0'}} Sats + {{(lqNode?.option_will_fund?.lease_fee_basis/100) | number:'1.2-2'}}%
</td>
</ng-container>
<ng-container matColumnDef="routingFee">
<th mat-header-cell *matHeaderCellDef> Routing Fee </th>
<td mat-cell *matCellDef="let lqNode">
<ng-container matColumnDef="routing_fee">
<th mat-header-cell *matHeaderCellDef class="pl-1"> Routing Fee </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
{{lqNode?.option_will_fund?.channel_fee_max_base_msat/1000 | number:'1.0-0'}} Sats + {{lqNode?.option_will_fund?.channel_fee_max_proportional_thousandths * 1000 | number:'1.0-0'}} ppm
</td>
</ng-container>
<ng-container matColumnDef="channelOpeningFee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Channel Opening Fee </th>
<td mat-cell *matCellDef="let lqNode">
<ng-container matColumnDef="channel_opening_fee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Channel Opening Fee (Sats) </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
<span fxLayoutAlign="end center">
{{lqNode.channel_opening_fee | number:'1.0-0'}}
</span>
</td>
</ng-container>
<ng-container matColumnDef="funding_weight">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before" class="pl-1"> Funding Weight </th>
<td mat-cell *matCellDef="let lqNode" class="pl-1">
<span fxLayoutAlign="end center">
{{lqNode.channelOpeningFee | number:'1.0-0'}} Sats
{{lqNode?.option_will_fund?.funding_weight | number:'1.0-0'}}
</span>
</td>
</ng-container>

@ -1,11 +1,12 @@
.mat-column-alias {
flex: 1 1 20%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
min-height: 4.8rem;
.mat-column-alias, .mat-column-nodeid {
flex: 0 0 15%;
width: 15%;
& .ellipsis-parent {
display: flex;
}
}
.mat-column-actions {
min-height: 4.8rem;
}

@ -10,7 +10,7 @@ import { faBullhorn, faExclamationTriangle, faUsers } from '@fortawesome/free-so
import { DataService } from '../../../shared/services/data.service';
import { LoggerService } from '../../../shared/services/logger.service';
import { CommonService } from '../../../shared/services/common.service';
import { AlertTypeEnum, APICallStatusEnum, DataTypeEnum, getPaginatorLabel, PAGE_SIZE, PAGE_SIZE_OPTIONS, ScreenSizeEnum, NODE_FEATURES_CLN } from '../../../shared/services/consts-enums-functions';
import { AlertTypeEnum, APICallStatusEnum, DataTypeEnum, getPaginatorLabel, PAGE_SIZE, PAGE_SIZE_OPTIONS, ScreenSizeEnum, NODE_FEATURES_CLN, SortOrderEnum, CLN_DEFAULT_PAGE_SETTINGS } from '../../../shared/services/consts-enums-functions';
import { GetInfo, LookupNode } from '../../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { openAlert, openConfirmation } from '../../../store/rtl.actions';
@ -18,8 +18,9 @@ import { openAlert, openConfirmation } from '../../../store/rtl.actions';
import { RTLState } from '../../../store/rtl.state';
import { RTLEffects } from '../../../store/rtl.effects';
import { CLNOpenLiquidityChannelComponent } from '../open-liquidity-channel-modal/open-liquidity-channel-modal.component';
import { nodeInfoAndNodeSettingsAndBalance } from '../../store/cln.selector';
import { clnPageSettings, nodeInfoAndNodeSettingsAndBalance } from '../../store/cln.selector';
import { DecimalPipe } from '@angular/common';
import { PageSettingsCLN, TableSetting } from '../../../shared/models/pageSettings';
@Component({
selector: 'rtl-cln-liquidity-ads-list',
@ -33,6 +34,8 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
public PAGE_ID = 'liquidity_ads';
public tableSetting: TableSetting = { tableId: 'liquidity_ads', recordsPerPage: PAGE_SIZE, sortBy: 'channel_opening_fee', sortOrder: SortOrderEnum.ASCENDING };
public askTooltipMsg = '';
public nodesTooltipMsg = '';
public displayedColumns: any[] = [];
@ -42,9 +45,9 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
public totalBalance = 0;
public information: GetInfo;
public channelAmount = 100000;
public channelOpeningFeeRate = 10;
public nodeCapacity = 500000;
public channelCount = 5;
public channel_opening_feeRate = 10;
public node_capacity = 500000;
public channel_count = 5;
public liquidityNodesData: LookupNode[] = [];
public liquidityNodes: any;
public pageSize = PAGE_SIZE;
@ -55,26 +58,34 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
public selFilter = '';
public apiCallStatus: ApiCallStatusPayload = { status: APICallStatusEnum.INITIATED };
public apiCallStatusEnum = APICallStatusEnum;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<RTLState>, private dataService: DataService, private commonService: CommonService, private rtlEffects: RTLEffects, private decimalPipe: DecimalPipe) {
this.askTooltipMsg = 'Specify the liquidity requirements for your node: \n 1. Channel Amount - Amount in Sats you need on the channel opened to your node \n 2. Channel opening fee rate - Rate in Sats/vByte that you are willing to pay to open the channel to you';
this.nodesTooltipMsg = 'These nodes are advertising their liquidity offering on the network.\nYou should pay attention to the following aspects to evaluate each node offer: \n- The total bitcoin deployed on the node, the more the better\n';
this.nodesTooltipMsg = this.nodesTooltipMsg + '- The number of channels open on the node, the more the better\n- The channel open fee which the node will charge from you\n- The routing fee which the node will charge on the payments, the lesser the better\n- The reliability of the node, ideally uptime. Refer to the information being provided by the node explorers';
this.screenSize = this.commonService.getScreenSize();
if (this.screenSize === ScreenSizeEnum.XS) {
this.displayedColumns = ['alias', 'channelOpeningFee', 'actions'];
} else if (this.screenSize === ScreenSizeEnum.SM) {
this.displayedColumns = ['alias', 'leaseFee', 'routingFee', 'channelOpeningFee', 'actions'];
} else if (this.screenSize === ScreenSizeEnum.MD) {
this.displayedColumns = ['alias', 'leaseFee', 'routingFee', 'channelOpeningFee', 'actions'];
} else {
this.displayedColumns = ['alias', 'leaseFee', 'routingFee', 'channelOpeningFee', 'actions'];
}
}
ngOnInit(): void {
combineLatest([this.store.select(nodeInfoAndNodeSettingsAndBalance), this.dataService.listNetworkNodes('?liquidity_ads=yes')]).pipe(takeUntil(this.unSubs[0])).
this.store.select(clnPageSettings).pipe(takeUntil(this.unSubs[0])).
subscribe((settings: { pageSettings: PageSettingsCLN[], apiCallStatus: ApiCallStatusPayload }) => {
this.errorMessage = '';
this.apiCallStatus = settings.apiCallStatus;
if (this.apiCallStatus.status === APICallStatusEnum.ERROR) {
this.errorMessage = this.apiCallStatus.message || '';
}
this.tableSetting = settings.pageSettings.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId) || CLN_DEFAULT_PAGE_SETTINGS.find((page) => page.pageId === this.PAGE_ID)?.tables.find((table) => table.tableId === this.tableSetting.tableId)!;
if (this.screenSize === ScreenSizeEnum.XS || this.screenSize === ScreenSizeEnum.SM) {
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM));
} else {
this.displayedColumns = JSON.parse(JSON.stringify(this.tableSetting.columnSelection));
}
this.displayedColumns.push('actions');
this.pageSize = this.tableSetting.recordsPerPage ? +this.tableSetting.recordsPerPage : PAGE_SIZE;
this.logger.info(this.displayedColumns);
});
combineLatest([this.store.select(nodeInfoAndNodeSettingsAndBalance), this.dataService.listNetworkNodes('?liquidity_ads=yes')]).pipe(takeUntil(this.unSubs[1])).
subscribe({
next: ([infoSettingsBalSelector, nodeListRes]) => {
this.information = infoSettingsBalSelector.information;
@ -106,7 +117,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
onCalculateOpeningFee() {
this.liquidityNodesData.forEach((lqNode) => {
if (lqNode.option_will_fund) {
lqNode.channelOpeningFee = (+(lqNode.option_will_fund.lease_fee_base_msat || 0) / 1000) + (this.channelAmount * (+(lqNode.option_will_fund.lease_fee_basis || 0)) / 10000) + ((+(lqNode.option_will_fund.funding_weight || 0) / 4) * this.channelOpeningFeeRate);
lqNode.channel_opening_fee = (+(lqNode.option_will_fund.lease_fee_base_msat || 0) / 1000) + (this.channelAmount * (+(lqNode.option_will_fund.lease_fee_basis || 0)) / 10000) + ((+(lqNode.option_will_fund.funding_weight || 0) / 4) * this.channel_opening_feeRate);
}
});
if (this.paginator) { this.paginator.firstPage(); }
@ -124,17 +135,17 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
this.liquidityNodes = new MatTableDataSource<LookupNode>([...liqNodes]);
this.liquidityNodes.sortingDataAccessor = (data: any, sortHeaderId: string) => ((data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null);
this.liquidityNodes.sort = this.sort;
this.liquidityNodes.paginator = this.paginator;
if (this.sort) { this.sort?.sort({ id: 'channelOpeningFee', start: 'asc', disableClear: true }); }
this.liquidityNodes.sort?.sort({ id: this.tableSetting.sortBy, start: this.tableSetting.sortOrder, disableClear: true });
this.liquidityNodes.filterPredicate = (node: LookupNode, fltr: string) => {
const newNode = ((node.alias) ? node.alias.toLocaleLowerCase() : '') + (node.channelOpeningFee ? node.channelOpeningFee + ' Sats' : '') +
const newNode = ((node.alias) ? node.alias.toLocaleLowerCase() : '') + (node.channel_opening_fee ? node.channel_opening_fee + ' Sats' : '') +
(node.option_will_fund?.lease_fee_base_msat ? (node.option_will_fund?.lease_fee_base_msat / 1000) + ' Sats' : '') + (node.option_will_fund?.lease_fee_basis ? (this.decimalPipe.transform(node.option_will_fund?.lease_fee_basis / 100, '1.2-2') + '%') : '') +
(node.option_will_fund?.channel_fee_max_base_msat ? (node.option_will_fund?.channel_fee_max_base_msat / 1000) + ' Sats' : '') + (node.option_will_fund?.channel_fee_max_proportional_thousandths ? (node.option_will_fund?.channel_fee_max_proportional_thousandths * 1000) + ' ppm' : '') +
(node.address_types ? node.address_types.reduce((acc, curr) => acc + (curr === 'tor' ? ' tor' : curr === 'ipv' ? ' clearnet' : (' ' + curr.toLowerCase())), '') : '');
return newNode.includes(fltr);
};
this.applyFilter();
// this.liquidityNodes.filterPredicate = (node: LookupNode, fltr: string) => node.channelCount >= this.channelCount && node.nodeCapacity >= this.nodeCapacity;
this.liquidityNodes.paginator = this.paginator;
// this.liquidityNodes.filterPredicate = (node: LookupNode, fltr: string) => node.channel_count >= this.channel_count && node.node_capacity >= this.node_capacity;
// this.onFilter();
}
@ -151,7 +162,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
node: lqNode,
balance: this.totalBalance,
requestedAmount: this.channelAmount,
feeRate: this.channelOpeningFeeRate,
feeRate: this.channel_opening_feeRate,
localAmount: 20000
};
this.store.dispatch(openAlert({
@ -203,7 +214,7 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
}
}
}));
this.rtlEffects.closeConfirm.pipe(takeUntil(this.unSubs[1])).subscribe((confirmRes) => {
this.rtlEffects.closeConfirm.pipe(takeUntil(this.unSubs[2])).subscribe((confirmRes) => {
if (confirmRes) {
this.onOpenChannel(lqNode);
}
@ -217,8 +228,8 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
}
onFilterReset() {
this.nodeCapacity = 0;
this.channelCount = 0;
this.node_capacity = 0;
this.channel_count = 0;
}
ngOnDestroy() {

@ -30,7 +30,7 @@
</mat-form-field>
</div>
<div fxFlex="100" class="alert alert-info mt-4">
<span>Total cost to lease {{node.channelOpeningFee | number}} (Sats)</span>
<span>Total cost to lease {{node.channel_opening_fee | number}} (Sats)</span>
</div>
<div fxFlex="100" class="alert alert-danger mt-2" *ngIf="channelConnectionError !== ''">
<fa-icon [icon]="faExclamationTriangle" class="mr-1 alert-icon"></fa-icon>

@ -55,7 +55,7 @@ describe('CLNOpenLiquidityChannelComponent', () => {
channel_fee_max_proportional_thousandths: 1,
compact_lease: '029a0032000100004e20'
},
channelOpeningFee: 22165
channel_opening_fee: 22165
},
balance: 100000, requestedAmount: 20000, feeRate: 10, localAmount: 20000
}

@ -68,7 +68,7 @@ export class CLNOpenLiquidityChannelComponent implements OnInit, OnDestroy {
}
calculateFee() {
this.node.channelOpeningFee = (+(this.node.option_will_fund?.lease_fee_base_msat || 0) / 1000) + (this.requestedAmount * (+(this.node.option_will_fund?.lease_fee_basis || 0)) / 10000) + ((+(this.node.option_will_fund?.funding_weight || 0) / 4) * this.feeRate);
this.node.channel_opening_fee = (+(this.node.option_will_fund?.lease_fee_base_msat || 0) / 1000) + (this.requestedAmount * (+(this.node.option_will_fund?.lease_fee_basis || 0)) / 10000) + ((+(this.node.option_will_fund?.funding_weight || 0) / 4) * this.feeRate);
}
onOpenChannel(): boolean | void {

@ -38,7 +38,7 @@ export class CLNChannelOpenTableComponent implements OnInit, AfterViewInit, OnDe
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
public faEye = faEye;
public faEyeSlash = faEyeSlash;
public PAGE_ID = 'peers/channels';
public PAGE_ID = 'peers_channels';
public tableSetting: TableSetting = { tableId: 'open_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
public totalBalance = 0;
public displayedColumns: any[] = [];

@ -36,7 +36,7 @@ export class CLNChannelPendingTableComponent implements OnInit, AfterViewInit, O
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
public faEye = faEye;
public faEyeSlash = faEyeSlash;
public PAGE_ID = 'peers/channels';
public PAGE_ID = 'peers_channels';
public tableSetting: TableSetting = { tableId: 'pending_inactive_channels', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
public isCompatibleVersion = false;
public totalBalance = 0;

@ -37,7 +37,7 @@ export class CLNPeersComponent implements OnInit, AfterViewInit, OnDestroy {
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
public faUsers = faUsers;
public PAGE_ID = 'peers/channels';
public PAGE_ID = 'peers_channels';
public tableSetting: TableSetting = { tableId: 'peers', recordsPerPage: PAGE_SIZE, sortBy: 'alias', sortOrder: SortOrderEnum.DESCENDING };
public newlyAddedPeer = '';
public displayedColumns: any[] = [];

@ -67,12 +67,12 @@
</div>
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch">
<mat-form-field fxFlex="49">
<input matInput [(ngModel)]="leaseFeeBaseSat" placeholder="Lease Base Fee (Sats)" type="number" step="100" min="0" tabindex="3" required name="leaseFeeBaseSat">
<mat-error *ngIf="!leaseFeeBaseSat">Lease base fee is required.</mat-error>
<input matInput [(ngModel)]="lease_fee_base_sat" placeholder="Lease Base Fee (Sats)" type="number" step="100" min="0" tabindex="3" required name="lease_fee_base_sat">
<mat-error *ngIf="!lease_fee_base_sat">Lease base fee is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="49">
<input matInput [(ngModel)]="leaseFeeBasis" placeholder="Lease Base Basis (bps)" type="number" step="1" min="0" tabindex="4" required name="leaseFeeBasis">
<mat-error *ngIf="!leaseFeeBasis">Lease base basis is required.</mat-error>
<input matInput [(ngModel)]="lease_fee_basis" placeholder="Lease Base Basis (bps)" type="number" step="1" min="0" tabindex="4" required name="lease_fee_basis">
<mat-error *ngIf="!lease_fee_basis">Lease base basis is required.</mat-error>
</mat-form-field>
</div>
<div fxLayout="column" fxLayout.gt-sm="row" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start stretch">

@ -36,8 +36,8 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
public policyTypes = LADS_POLICY;
public selPolicyType = LADS_POLICY[0];
public policyMod: number | null;
public leaseFeeBaseSat: number | null;
public leaseFeeBasis: number | null;
public lease_fee_base_sat: number | null;
public lease_fee_basis: number | null;
public channelFeeMaxBaseSat: number | null;
public channelFeeMaxProportional: number | null;
public flgUpdateCalled = false;
@ -79,8 +79,8 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
this.selPolicyType = LADS_POLICY.find((policy) => policy.id === this.fundingPolicy.policy) || this.policyTypes[0];
}
this.policyMod = this.fundingPolicy.policy_mod || this.fundingPolicy.policy_mod === 0 ? this.fundingPolicy.policy_mod : null;
this.leaseFeeBaseSat = this.fundingPolicy.lease_fee_base_msat ? this.fundingPolicy.lease_fee_base_msat / 1000 : this.fundingPolicy.lease_fee_base_msat === 0 ? 0 : null;
this.leaseFeeBasis = this.fundingPolicy.lease_fee_basis || this.fundingPolicy.lease_fee_basis === 0 ? this.fundingPolicy.lease_fee_basis : null;
this.lease_fee_base_sat = this.fundingPolicy.lease_fee_base_msat ? this.fundingPolicy.lease_fee_base_msat / 1000 : this.fundingPolicy.lease_fee_base_msat === 0 ? 0 : null;
this.lease_fee_basis = this.fundingPolicy.lease_fee_basis || this.fundingPolicy.lease_fee_basis === 0 ? this.fundingPolicy.lease_fee_basis : null;
this.channelFeeMaxBaseSat = this.fundingPolicy.channel_fee_max_base_msat ? this.fundingPolicy.channel_fee_max_base_msat / 1000 : this.fundingPolicy.channel_fee_max_base_msat === 0 ? 0 : null;
this.channelFeeMaxProportional = this.fundingPolicy.channel_fee_max_proportional_thousandths || this.fundingPolicy.channel_fee_max_proportional_thousandths === 0 ? (this.fundingPolicy.channel_fee_max_proportional_thousandths * 1000) : null;
});
@ -115,7 +115,7 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
onUpdateFundingPolicy() {
this.flgUpdateCalled = true;
this.updateMsg = {};
this.dataService.getOrUpdateFunderPolicy(this.selPolicyType.id, this.policyMod, ((this.leaseFeeBaseSat || 0) * 1000), this.leaseFeeBasis, (this.channelFeeMaxBaseSat || 0) * 1000, this.channelFeeMaxProportional ? this.channelFeeMaxProportional / 1000 : 0).
this.dataService.getOrUpdateFunderPolicy(this.selPolicyType.id, this.policyMod, ((this.lease_fee_base_sat || 0) * 1000), this.lease_fee_basis, (this.channelFeeMaxBaseSat || 0) * 1000, this.channelFeeMaxProportional ? this.channelFeeMaxProportional / 1000 : 0).
pipe(takeUntil(this.unSubs[4])).
subscribe({
next: (updatePolicyRes: any) => {
@ -140,8 +140,8 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
this.selPolicyType = LADS_POLICY[0];
}
this.policyMod = this.fundingPolicy.policy_mod || this.fundingPolicy.policy_mod === 0 ? this.fundingPolicy.policy_mod : null;
this.leaseFeeBaseSat = this.fundingPolicy.lease_fee_base_msat ? this.fundingPolicy.lease_fee_base_msat / 1000 : this.fundingPolicy.lease_fee_base_msat === 0 ? 0 : null;
this.leaseFeeBasis = this.fundingPolicy.lease_fee_basis || this.fundingPolicy.lease_fee_basis === 0 ? this.fundingPolicy.lease_fee_basis : null;
this.lease_fee_base_sat = this.fundingPolicy.lease_fee_base_msat ? this.fundingPolicy.lease_fee_base_msat / 1000 : this.fundingPolicy.lease_fee_base_msat === 0 ? 0 : null;
this.lease_fee_basis = this.fundingPolicy.lease_fee_basis || this.fundingPolicy.lease_fee_basis === 0 ? this.fundingPolicy.lease_fee_basis : null;
this.channelFeeMaxBaseSat = this.fundingPolicy.channel_fee_max_base_msat ? this.fundingPolicy.channel_fee_max_base_msat / 1000 : this.fundingPolicy.channel_fee_max_base_msat === 0 ? 0 : null;
this.channelFeeMaxProportional = this.fundingPolicy.channel_fee_max_proportional_thousandths || this.fundingPolicy.channel_fee_max_proportional_thousandths === 0 ? (this.fundingPolicy.channel_fee_max_proportional_thousandths * 1000) : null;
}

@ -5,9 +5,9 @@
<span class="page-title">Grid Settings</span>
</div>
<ng-container *ngIf="errorMessage && errorMessage.page === 'unknown'" [ngTemplateOutlet]="errorObjectBlock" [ngTemplateOutletContext]="{error: errorMessage}"></ng-container>
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel mt-1" [ngClass]="{'error-border': errorMessage?.page === page.pageId}" expanded="true" *ngFor="let page of pageSettings">
<mat-expansion-panel fxLayout="column" class="flat-expansion-panel mt-1" [ngClass]="{'error-border': errorMessage?.page === page.pageId}" expanded="false" *ngFor="let page of pageSettings">
<mat-expansion-panel-header>
<mat-panel-title>{{page.pageId | camelcase}}</mat-panel-title>
<mat-panel-title>{{page.pageId | camelcaseWithReplace:'_'}}</mat-panel-title>
</mat-expansion-panel-header>
<div fxLayout="column" fxLayoutAlign="start stretch" *ngFor="let table of page.tables" class="padding-gap-x-large table-setting-row">
<div fxLayout="row" fxLayoutAlign="space-between center">

@ -347,9 +347,9 @@ export interface LookupNode {
last_timestamp?: number;
address_types?: string[];
features?: string;
channelCount?: number;
nodeCapacity?: number;
channelOpeningFee?: number;
channel_count?: number;
node_capacity?: number;
channel_opening_fee?: number;
addresses?: Address[];
option_will_fund?: {
lease_fee_base_msat?: number;

@ -683,7 +683,7 @@ export const CLN_DEFAULT_PAGE_SETTINGS: PageSettingsCLN[] = [
columnSelectionSM: ['txid', 'value'],
columnSelection: ['txid', 'output', 'value', 'blockheight'] }
] },
{ pageId: 'peers/channels', tables: [
{ pageId: 'peers_channels', tables: [
{ tableId: 'open_channels', recordsPerPage: PAGE_SIZE, sortBy: 'msatoshi_to_us', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['alias', 'msatoshi_to_us', 'msatoshi_to_them'],
columnSelection: ['short_channel_id', 'alias', 'msatoshi_to_us', 'msatoshi_to_them', 'balancedness'] },
@ -694,6 +694,11 @@ export const CLN_DEFAULT_PAGE_SETTINGS: PageSettingsCLN[] = [
columnSelectionSM: ['alias', 'id'],
columnSelection: ['alias', 'id', 'netaddr'] }
] },
{ pageId: 'liquidity_ads', tables: [
{ tableId: 'liquidity_ads', recordsPerPage: PAGE_SIZE, sortBy: 'channel_opening_fee', sortOrder: SortOrderEnum.ASCENDING,
columnSelectionSM: ['alias', 'channel_opening_fee'],
columnSelection: ['alias', 'last_timestamp', 'lease_fee', 'routing_fee', 'channel_opening_fee'] }
] },
{ pageId: 'transactions', tables: [
{ tableId: 'payments', recordsPerPage: PAGE_SIZE, sortBy: 'created_at', sortOrder: SortOrderEnum.DESCENDING,
columnSelectionSM: ['created_at', 'msatoshi'],
@ -719,6 +724,10 @@ export const CLN_TABLES_DEF = {
maxColumns: 7,
allowedColumns: ['txid', 'address', 'scriptpubkey', 'output', 'value', 'blockheight', 'reserved']
},
liquidity_ads: {
maxColumns: 8,
allowedColumns: ['alias', 'nodeid', 'last_timestamp', 'compact_lease', 'lease_fee', 'routing_fee', 'channel_opening_fee', 'funding_weight']
},
open_channels: {
maxColumns: 8,
allowedColumns: ['short_channel_id', 'alias', 'id', 'channel_id', 'funding_txid', 'connected', 'our_channel_reserve_satoshis', 'their_channel_reserve_satoshis', 'msatoshi_total', 'spendable_msatoshi', 'msatoshi_to_us', 'msatoshi_to_them', 'balancedness']

@ -313,9 +313,9 @@ export class DataService implements OnDestroy {
}));
}
getOrUpdateFunderPolicy(policy?: any, policyMod?: any, leaseFeeBaseMsat?: any, leaseFeeBasis?: any, channelFeeMaxBaseMsat?: any, channelFeeMaxProportional?: any) {
getOrUpdateFunderPolicy(policy?: any, policyMod?: any, lease_feeBaseMsat?: any, lease_fee_basis?: any, channelFeeMaxBaseMsat?: any, channelFeeMaxProportional?: any) {
return this.lnImplementationUpdated.pipe(first((val) => val !== null), mergeMap((updatedLnImplementation) => {
const postParams = policy ? { policy: policy, policy_mod: policyMod, lease_fee_base_msat: leaseFeeBaseMsat, lease_fee_basis: leaseFeeBasis, channel_fee_max_base_msat: channelFeeMaxBaseMsat, channel_fee_max_proportional_thousandths: channelFeeMaxProportional } : null;
const postParams = policy ? { policy: policy, policy_mod: policyMod, lease_fee_base_msat: lease_feeBaseMsat, lease_fee_basis: lease_fee_basis, channel_fee_max_base_msat: channelFeeMaxBaseMsat, channel_fee_max_proportional_thousandths: channelFeeMaxProportional } : null;
this.store.dispatch(openSpinner({ payload: UI_MESSAGES.GET_FUNDER_POLICY }));
return this.httpClient.post(this.APIUrl + '/' + updatedLnImplementation + environment.CHANNELS_API + '/funderUpdate', postParams).pipe(
takeUntil(this.unSubs[11]),

@ -697,7 +697,7 @@ export const mockResponseData = {
channel_fee_max_proportional_thousandths: 1,
compact_lease: '029a0032000100004e20'
},
channelOpeningFee: 22165
channel_opening_fee: 22165
},
{
nodeid: '023b485342839753dea66ff280df74e73570abc8160ad9a3456267dc5249e7a749',
@ -720,7 +720,7 @@ export const mockResponseData = {
channel_fee_max_proportional_thousandths: 1,
compact_lease: '029a003200010000271003e8'
},
channelOpeningFee: 12165
channel_opening_fee: 12165
}
],
setSelectedNodeSuccess: {

Loading…
Cancel
Save