| | | 1 | | using NLightning.Domain.Channels.Enums; |
| | | 2 | | |
| | | 3 | | namespace NLightning.Client.Printers; |
| | | 4 | | |
| | | 5 | | using Transport.Ipc.Responses; |
| | | 6 | | |
| | | 7 | | public sealed class OpenChannelSubscriptionPrinter : IPrinter<OpenChannelSubscriptionIpcResponse> |
| | | 8 | | { |
| | | 9 | | public void Print(OpenChannelSubscriptionIpcResponse item) |
| | 0 | 10 | | { |
| | 0 | 11 | | switch (item.ChannelState) |
| | | 12 | | { |
| | | 13 | | case ChannelState.V1FundingSigned: |
| | 0 | 14 | | Console.WriteLine("Peer sent their signature. Sending ours."); |
| | 0 | 15 | | Console.WriteLine("Funding transaction published. TxId: {0}, Index: {1}", item.TxId, item.Index); |
| | 0 | 16 | | Console.WriteLine("Waiting for confirmations."); |
| | 0 | 17 | | Console.WriteLine("You can either wait for the full confirmation or press CTRL+C to quit."); |
| | 0 | 18 | | break; |
| | | 19 | | case ChannelState.ReadyForThem or ChannelState.ReadyForUs: |
| | 0 | 20 | | Console.WriteLine("Channel is now open!"); |
| | 0 | 21 | | break; |
| | | 22 | | default: |
| | 0 | 23 | | Console.WriteLine("We've got an unexpected Channel state update: {0}", |
| | 0 | 24 | | Enum.GetName(typeof(ChannelState), item.ChannelState)); |
| | 0 | 25 | | break; |
| | | 26 | | } |
| | 0 | 27 | | } |
| | | 28 | | } |