2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-10-31 09:20:27 +00:00
RTL/src/app/lnd/home/channel-liquidity-info/channel-liquidity-info.component.ts

22 lines
728 B
TypeScript
Raw Normal View History

import { Component, OnChanges, Input } from '@angular/core';
import { Channel } from '../../../shared/models/lndModels';
@Component({
selector: 'rtl-channel-liquidity-info',
templateUrl: './channel-liquidity-info.component.html',
styleUrls: ['./channel-liquidity-info.component.scss']
})
export class ChannelLiquidityInfoComponent implements OnChanges {
@Input() direction: string;
@Input() totalLiquidity: number;
@Input() allChannels: Channel[];
public maxTransactionAmount = 0;
constructor() {}
ngOnChanges() {
this.maxTransactionAmount = this.allChannels && this.allChannels.length > 0 ? (this.direction === 'In' ? this.allChannels[0].remote_balance : this.allChannels[0].local_balance) : 0;
}
}