You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
968 B
TypeScript
29 lines
968 B
TypeScript
4 years ago
|
import { Component, OnChanges, Input } from '@angular/core';
|
||
|
|
||
|
import { ChannelCL } from '../../../shared/models/clModels';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'rtl-cl-channel-liquidity-info',
|
||
|
templateUrl: './channel-liquidity-info.component.html',
|
||
|
styleUrls: ['./channel-liquidity-info.component.scss']
|
||
|
})
|
||
|
export class CLChannelLiquidityInfoComponent implements OnChanges {
|
||
|
@Input() direction: string;
|
||
|
@Input() totalLiquidity: number;
|
||
|
@Input() allChannels: ChannelCL[];
|
||
|
public maxAmount = 0;
|
||
|
|
||
|
constructor() {}
|
||
|
|
||
|
ngOnChanges() {
|
||
|
if (this.allChannels && this.allChannels.length > 0) {
|
||
|
if(this.direction === 'In') {
|
||
|
this.maxAmount = +this.allChannels[0].their_channel_reserve_satoshis <= 4294967 ? +this.allChannels[0].their_channel_reserve_satoshis : 4294967;
|
||
|
} else {
|
||
|
this.maxAmount = +this.allChannels[0].our_channel_reserve_satoshis <= 4294967 ? +this.allChannels[0].our_channel_reserve_satoshis : 4294967;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|