mirror of https://github.com/lukechilds/polar.git
jamaljsr
5 years ago
5 changed files with 73 additions and 5 deletions
@ -0,0 +1,26 @@ |
|||
import { Channel, PendingChannel } from '@radar/lnrpc'; |
|||
import { LightningNodeChannel } from 'lib/lightning/types'; |
|||
|
|||
export const mapOpenChannel = (chan: Channel): LightningNodeChannel => ({ |
|||
pending: false, |
|||
uniqueId: chan.channelPoint.slice(-12), |
|||
channelPoint: chan.channelPoint, |
|||
pubkey: chan.remotePubkey, |
|||
capacity: chan.capacity, |
|||
localBalance: chan.localBalance, |
|||
remoteBalance: chan.remoteBalance, |
|||
status: 'Open', |
|||
}); |
|||
|
|||
export const mapPendingChannel = (status: string) => ( |
|||
chan: PendingChannel, |
|||
): LightningNodeChannel => ({ |
|||
pending: true, |
|||
uniqueId: chan.channelPoint.slice(-12), |
|||
channelPoint: chan.channelPoint, |
|||
pubkey: chan.remoteNodePub, |
|||
capacity: chan.capacity, |
|||
localBalance: chan.localBalance, |
|||
remoteBalance: chan.remoteBalance, |
|||
status, |
|||
}); |
Loading…
Reference in new issue