diff --git a/BTCPayServer.Tests/Lnd/LndMockTester.cs b/BTCPayServer.Tests/Lnd/LndMockTester.cs new file mode 100644 index 000000000..3ee701614 --- /dev/null +++ b/BTCPayServer.Tests/Lnd/LndMockTester.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; +using BTCPayServer.Payments.Lightning.Lnd; +using NBitcoin; + +namespace BTCPayServer.Tests.Lnd +{ + public class LndMockTester + { + private ServerTester _Parent; + + public LndMockTester(ServerTester serverTester, string environmentName, string defaultValue, string defaultHost, Network network) + { + this._Parent = serverTester; + var url = serverTester.GetEnvironment(environmentName, defaultValue); + + Swagger = LndSwaggerClientCustomHttp.Create(new Uri(url), network); + Client = new LndInvoiceClient(Swagger); + P2PHost = _Parent.GetEnvironment(environmentName + "_HOST", defaultHost); + } + + public LndSwaggerClientCustomHttp Swagger { get; set; } + public LndInvoiceClient Client { get; set; } + public string P2PHost { get; } + } +} diff --git a/BTCPayServer.Tests/Lnd/UnitTests.cs b/BTCPayServer.Tests/Lnd/UnitTests.cs new file mode 100644 index 000000000..25c91f0bc --- /dev/null +++ b/BTCPayServer.Tests/Lnd/UnitTests.cs @@ -0,0 +1,203 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using BTCPayServer.Payments.Lightning; +using BTCPayServer.Payments.Lightning.Lnd; +using NBitcoin; +using NBitcoin.RPC; +using Xunit; +using Xunit.Abstractions; +using System.Linq; +using System.Threading; +using NBitpayClient; +using System.Globalization; + +namespace BTCPayServer.Tests.Lnd +{ + // this depends for now on `docker-compose up devlnd` + public class UnitTests + { + private readonly ITestOutputHelper output; + + public UnitTests(ITestOutputHelper output) + { + this.output = output; + initializeEnvironment(); + + MerchantLnd = LndSwaggerClientCustomHttp.Create(new Uri("http://127.0.0.1:53280"), Network.RegTest); + InvoiceClient = new LndInvoiceClient(MerchantLnd); + + CustomerLnd = LndSwaggerClientCustomHttp.Create(new Uri("http://127.0.0.1:53281"), Network.RegTest); + } + + private LndSwaggerClientCustomHttp MerchantLnd { get; set; } + private LndInvoiceClient InvoiceClient { get; set; } + + private LndSwaggerClientCustomHttp CustomerLnd { get; set; } + + [Fact] + public async Task GetInfo() + { + var res = await InvoiceClient.GetInfo(); + output.WriteLine("Result: " + res.ToJson()); + } + + [Fact] + public async Task CreateInvoice() + { + var res = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600)); + output.WriteLine("Result: " + res.ToJson()); + } + + [Fact] + public async Task GetInvoice() + { + var createInvoice = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600)); + var getInvoice = await InvoiceClient.GetInvoice(createInvoice.Id); + + Assert.Equal(createInvoice.BOLT11, getInvoice.BOLT11); + } + + // integration tests + [Fact] + public async Task TestWaitListenInvoice() + { + var merchantInvoice = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600)); + + var waitToken = default(CancellationToken); + var listener = await InvoiceClient.Listen(waitToken); + var waitTask = listener.WaitInvoice(waitToken); + + await EnsureLightningChannelAsync(); + var payResponse = await CustomerLnd.SendPaymentSyncAsync(new LnrpcSendRequest + { + Payment_request = merchantInvoice.BOLT11 + }); + + var invoice = await waitTask; + + Assert.True(invoice.PaidAt.HasValue); + } + + [Fact] + public async Task CreateLndInvoiceAndPay() + { + var merchantInvoice = await InvoiceClient.CreateInvoice(10000, "Hello world", TimeSpan.FromSeconds(3600)); + + await EnsureLightningChannelAsync(); + var payResponse = await CustomerLnd.SendPaymentSyncAsync(new LnrpcSendRequest + { + Payment_request = merchantInvoice.BOLT11 + }); + + var invoice = await InvoiceClient.GetInvoice(merchantInvoice.Id); + + Assert.True(invoice.PaidAt.HasValue); + } + + + public async Task EnsureLightningChannelAsync() + { + var merchantInfo = await WaitLNSynched(); + var merchantNodeAddress = new LnrpcLightningAddress + { + Pubkey = merchantInfo.NodeId, + Host = "merchant_lnd:9735" + }; + + while (true) + { + // if channel is pending generate blocks until confirmed + var pendingResponse = await CustomerLnd.PendingChannelsAsync(); + if (pendingResponse.Pending_open_channels? + .Any(a => a.Channel?.Remote_node_pub == merchantNodeAddress.Pubkey) == true) + { + ExplorerNode.Generate(1); + await WaitLNSynched(); + continue; + } + + // check if channel is established + var chanResponse = await CustomerLnd.ListChannelsAsync(null, null, null, null); + LnrpcChannel channelToMerchant = null; + if (chanResponse != null && chanResponse.Channels != null) + { + channelToMerchant = chanResponse.Channels + .Where(a => a.Remote_pubkey == merchantNodeAddress.Pubkey) + .FirstOrDefault(); + } + + if (channelToMerchant == null) + { + // create new channel + var isConnected = await CustomerLnd.ListPeersAsync(); + if (isConnected.Peers == null || + !isConnected.Peers.Any(a => a.Pub_key == merchantInfo.NodeId)) + { + var connectResp = await CustomerLnd.ConnectPeerAsync(new LnrpcConnectPeerRequest + { + Addr = merchantNodeAddress + }); + } + + var addressResponse = await CustomerLnd.NewWitnessAddressAsync(); + var address = BitcoinAddress.Create(addressResponse.Address, Network.RegTest); + await ExplorerNode.SendToAddressAsync(address, Money.Coins(0.2m)); + ExplorerNode.Generate(1); + await WaitLNSynched(); + + var channelReq = new LnrpcOpenChannelRequest + { + Local_funding_amount = 16777215.ToString(CultureInfo.InvariantCulture), + Node_pubkey_string = merchantInfo.NodeId + }; + var channelResp = await CustomerLnd.OpenChannelSyncAsync(channelReq); + } + else + { + // channel exists, return it + ExplorerNode.Generate(1); + await WaitLNSynched(); + return channelToMerchant; + } + } + } + + private async Task WaitLNSynched() + { + while (true) + { + var merchantInfo = await InvoiceClient.GetInfo(); + var blockCount = await ExplorerNode.GetBlockCountAsync(); + if (merchantInfo.BlockHeight != blockCount) + { + await Task.Delay(500); + } + else + { + return merchantInfo; + } + } + } + + + + + // + private void initializeEnvironment() + { + NetworkProvider = new BTCPayNetworkProvider(NetworkType.Regtest); + ExplorerNode = new RPCClient(RPCCredentialString.Parse(GetEnvironment("TESTS_BTCRPCCONNECTION", "server=http://127.0.0.1:43782;ceiwHEbqWI83:DwubwWsoo3")), NetworkProvider.GetNetwork("BTC").NBitcoinNetwork); + } + + public BTCPayNetworkProvider NetworkProvider { get; private set; } + public RPCClient ExplorerNode { get; set; } + + internal string GetEnvironment(string variable, string defaultValue) + { + var var = Environment.GetEnvironmentVariable(variable); + return String.IsNullOrEmpty(var) ? defaultValue : var; + } + } +} diff --git a/BTCPayServer.Tests/ServerTester.cs b/BTCPayServer.Tests/ServerTester.cs index d6b6e4fba..f05961106 100644 --- a/BTCPayServer.Tests/ServerTester.cs +++ b/BTCPayServer.Tests/ServerTester.cs @@ -20,6 +20,7 @@ using System.Threading; using System.Globalization; using BTCPayServer.Payments.Lightning.CLightning; using BTCPayServer.Payments.Lightning.Charge; +using BTCPayServer.Tests.Lnd; using BTCPayServer.Payments.Lightning; namespace BTCPayServer.Tests @@ -53,6 +54,8 @@ namespace BTCPayServer.Tests MerchantCharge = new ChargeTester(this, "TEST_MERCHANTCHARGE", "type=charge;server=http://127.0.0.1:54938/;api-token=foiewnccewuify", "merchant_lightningd", btc); + MerchantLnd = new LndMockTester(this, "TEST_MERCHANTLND", "http://lnd:lnd@127.0.0.1:53280/", "merchant_lnd", btc); + PayTester = new BTCPayServerTester(Path.Combine(_Directory, "pay")) { NBXplorerUri = ExplorerClient.Address, @@ -79,41 +82,52 @@ namespace BTCPayServer.Tests /// /// Connect a customer LN node to the merchant LN node /// - public void PrepareLightning() + public void PrepareLightning(LightningConnectionType lndBackend) { - PrepareLightningAsync().GetAwaiter().GetResult(); + ILightningInvoiceClient client = MerchantCharge.Client; + if (lndBackend == LightningConnectionType.Lnd) + client = MerchantLnd.Client; + + PrepareLightningAsync(client).GetAwaiter().GetResult(); } + private static readonly string[] SKIPPED_STATES = + { "ONCHAIN", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "FUNDING_SPEND_SEEN" }; + /// /// Connect a customer LN node to the merchant LN node /// /// - public async Task PrepareLightningAsync() + private async Task PrepareLightningAsync(ILightningInvoiceClient client) { while (true) { - var skippedStates = new[] { "ONCHAIN", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "FUNDING_SPEND_SEEN" }; - var channel = (await CustomerLightningD.ListPeersAsync()) + var merchantInfo = await WaitLNSynched(client, CustomerLightningD, MerchantLightningD); + + var peers = await CustomerLightningD.ListPeersAsync(); + var filteringToTargetedPeers = peers.Where(a => a.Id == merchantInfo.NodeId); + var channel = filteringToTargetedPeers .SelectMany(p => p.Channels) - .Where(c => !skippedStates.Contains(c.State ?? "")) + .Where(c => !SKIPPED_STATES.Contains(c.State ?? "")) .FirstOrDefault(); + switch (channel?.State) { case null: - var merchantInfo = await WaitLNSynched(); - var clightning = new NodeInfo(merchantInfo.Id, MerchantCharge.P2PHost, merchantInfo.Port); - await CustomerLightningD.ConnectAsync(clightning); var address = await CustomerLightningD.NewAddressAsync(); - await ExplorerNode.SendToAddressAsync(address, Money.Coins(0.2m)); + await ExplorerNode.SendToAddressAsync(address, Money.Coins(0.5m)); ExplorerNode.Generate(1); - await WaitLNSynched(); + await WaitLNSynched(client, CustomerLightningD, MerchantLightningD); await Task.Delay(1000); - await CustomerLightningD.FundChannelAsync(clightning, Money.Satoshis(16777215)); + + var merchantNodeInfo = new NodeInfo(merchantInfo.NodeId, merchantInfo.Address, merchantInfo.P2PPort); + await CustomerLightningD.ConnectAsync(merchantNodeInfo); + await CustomerLightningD.FundChannelAsync(merchantNodeInfo, Money.Satoshis(16777215)); break; case "CHANNELD_AWAITING_LOCKIN": ExplorerNode.Generate(1); - await WaitLNSynched(); + await WaitLNSynched(client, CustomerLightningD, MerchantLightningD); break; case "CHANNELD_NORMAL": return; @@ -123,23 +137,29 @@ namespace BTCPayServer.Tests } } - private async Task WaitLNSynched() + private async Task WaitLNSynched(params ILightningInvoiceClient[] clients) { while (true) { - var merchantInfo = await MerchantCharge.Client.GetInfoAsync(); var blockCount = await ExplorerNode.GetBlockCountAsync(); - if (merchantInfo.BlockHeight != blockCount) - { - await Task.Delay(1000); - } - else - { - return merchantInfo; - } + var synching = clients.Select(c => WaitLNSynchedCore(blockCount, c)).ToArray(); + await Task.WhenAll(synching); + if (synching.All(c => c.Result != null)) + return synching[0].Result; + await Task.Delay(1000); } } + private async Task WaitLNSynchedCore(int blockCount, ILightningInvoiceClient client) + { + var merchantInfo = await client.GetInfo(); + if (merchantInfo.BlockHeight == blockCount) + { + return merchantInfo; + } + return null; + } + public void SendLightningPayment(Invoice invoice) { SendLightningPaymentAsync(invoice).GetAwaiter().GetResult(); @@ -153,8 +173,10 @@ namespace BTCPayServer.Tests } public CLightningRPCClient CustomerLightningD { get; set; } + public CLightningRPCClient MerchantLightningD { get; private set; } public ChargeTester MerchantCharge { get; private set; } + public LndMockTester MerchantLnd { get; set; } internal string GetEnvironment(string variable, string defaultValue) { diff --git a/BTCPayServer.Tests/TestAccount.cs b/BTCPayServer.Tests/TestAccount.cs index 4c9e921e9..9b55403e5 100644 --- a/BTCPayServer.Tests/TestAccount.cs +++ b/BTCPayServer.Tests/TestAccount.cs @@ -126,11 +126,20 @@ namespace BTCPayServer.Tests public async Task RegisterLightningNodeAsync(string cryptoCode, LightningConnectionType connectionType) { var storeController = this.GetController(); + + string connectionString = null; + if (connectionType == LightningConnectionType.Charge) + connectionString = "type=charge;server=" + parent.MerchantCharge.Client.Uri.AbsoluteUri; + else if (connectionType == LightningConnectionType.CLightning) + connectionString = "type=clightning;server=" + parent.MerchantLightningD.Address.AbsoluteUri; + else if (connectionType == LightningConnectionType.Lnd) + connectionString = $"type=lnd;server={parent.MerchantLnd.Swagger.BaseUrl}"; + else + throw new NotSupportedException(connectionType.ToString()); + await storeController.AddLightningNode(StoreId, new LightningNodeViewModel() { - ConnectionString = connectionType == LightningConnectionType.Charge ? "type=charge;server=" + parent.MerchantCharge.Client.Uri.AbsoluteUri : - connectionType == LightningConnectionType.CLightning ? "type=clightning;server=" + parent.MerchantLightningD.Address.AbsoluteUri - : throw new NotSupportedException(connectionType.ToString()), + ConnectionString = connectionString, SkipPortTest = true }, "save", "BTC"); if (storeController.ModelState.ErrorCount != 0) diff --git a/BTCPayServer.Tests/UnitTest1.cs b/BTCPayServer.Tests/UnitTest1.cs index e315554f3..9948470e0 100644 --- a/BTCPayServer.Tests/UnitTest1.cs +++ b/BTCPayServer.Tests/UnitTest1.cs @@ -512,71 +512,52 @@ namespace BTCPayServer.Tests Assert.True(LightningConnectionString.TryParse("type=clightning;server=/aaa:bbb@test/a", false, out conn)); Assert.True(LightningConnectionString.TryParse("type=clightning;server=unix://aaa:bbb@test/a", false, out conn)); Assert.False(LightningConnectionString.TryParse("type=clightning;server=wtf://aaa:bbb@test/a", false, out conn)); + + var macaroon = "0201036c6e640247030a10b0dbbde28f009f83d330bde05075ca251201301a160a0761646472657373120472656164120577726974651a170a08696e766f6963657312047265616412057772697465000006200ae088692e67cf14e767c3d2a4a67ce489150bf810654ff980e1b7a7e263d5e8"; + var tls = "2d2d2d2d2d424547494e2043455254494649434154452d2d2d2d2d0a4d494942396a4343415a7967417749424167495156397a62474252724e54716b4e4b55676d72524d377a414b42676771686b6a4f50515144416a41784d5238770a485159445651514b45785a73626d5167595856306232646c626d56795958526c5a43426a5a584a304d51347744415944565151444577564754304e56557a41650a467730784f4441304d6a55794d7a517a4d6a4261467730784f5441324d6a41794d7a517a4d6a42614d444578487a416442674e5642416f54466d78755a4342680a645852765a3256755a584a686447566b49474e6c636e5178446a414d42674e5642414d5442555a50513156544d466b77457759484b6f5a497a6a3043415159490a4b6f5a497a6a304441516344516741454b7557424568564f75707965434157476130766e713262712f59396b41755a78616865646d454553482b753936436d450a397577486b4b2b4a7667547a66385141783550513741357254637155374b57595170303175364f426c5443426b6a414f42674e56485138424166384542414d430a4171517744775944565230544151482f42415577417745422f7a427642674e56485245456144426d6767564754304e565534494a6247396a5957786f62334e300a6877522f4141414268784141414141414141414141414141414141414141414268775373474f69786877514b41457342687753702f717473687754417141724c0a687753702f6d4a72687753702f754f77687753702f714e59687753702f6874436877514b70514157687753702f6c42514d416f4743437147534d343942414d430a413067414d45554349464866716d595a5043647a4a5178386b47586859473834394c31766541364c784d6f7a4f5774356d726835416945413662756e51556c710a6558553070474168776c3041654d726a4d4974394c7652736179756162565a593278343d0a2d2d2d2d2d454e442043455254494649434154452d2d2d2d2d0a"; + var lndUri = $"type=lnd;server=https://lnd:lnd@127.0.0.1:53280/;macaroon={macaroon};tls={tls}"; + + Assert.True(LightningConnectionString.TryParse(lndUri, false, out conn)); + Assert.Equal(lndUri, conn.ToString()); + Assert.Equal(LightningConnectionType.Lnd, conn.ConnectionType); + Assert.Equal(macaroon, Encoders.Hex.EncodeData(conn.Macaroon)); + Assert.Equal(tls, Encoders.Hex.EncodeData(conn.Tls)); } [Fact] public void CanSendLightningPaymentCLightning() { - using (var tester = ServerTester.Create()) - { - tester.Start(); - tester.PrepareLightning(); - var user = tester.NewAccount(); - user.GrantAccess(); - user.RegisterLightningNode("BTC", LightningConnectionType.CLightning); - user.RegisterDerivationScheme("BTC"); - - var invoice = user.BitPay.CreateInvoice(new Invoice() - { - Price = 0.01m, - Currency = "USD", - PosData = "posData", - OrderId = "orderId", - ItemDesc = "Some description" - }); - - tester.SendLightningPayment(invoice); - - Eventually(() => - { - var localInvoice = user.BitPay.GetInvoice(invoice.Id); - Assert.Equal("complete", localInvoice.Status); - Assert.Equal("False", localInvoice.ExceptionStatus.ToString()); - }); - } + ProcessLightningPayment(LightningConnectionType.CLightning); } [Fact] public void CanSendLightningPaymentCharge() { + ProcessLightningPayment(LightningConnectionType.Charge); + } + + [Fact] + public void CanSendLightningPaymentLnd() + { + ProcessLightningPayment(LightningConnectionType.Lnd); + } + + void ProcessLightningPayment(LightningConnectionType type) + { + // For easier debugging and testing + // LightningLikePaymentHandler.LIGHTNING_TIMEOUT = int.MaxValue; using (var tester = ServerTester.Create()) { tester.Start(); - tester.PrepareLightning(); var user = tester.NewAccount(); user.GrantAccess(); - user.RegisterLightningNode("BTC", LightningConnectionType.Charge); + user.RegisterLightningNode("BTC", type); user.RegisterDerivationScheme("BTC"); + + tester.PrepareLightning(type); - var invoice = user.BitPay.CreateInvoice(new Invoice() - { - Price = 0.01m, - Currency = "USD", - PosData = "posData", - OrderId = "orderId", - ItemDesc = "Some description" - }); - - tester.SendLightningPayment(invoice); - - Eventually(() => - { - var localInvoice = user.BitPay.GetInvoice(invoice.Id); - Assert.Equal("complete", localInvoice.Status); - Assert.Equal("False", localInvoice.ExceptionStatus.ToString()); - }); - + Task.WaitAll(CanSendLightningPaymentCore(tester, user)); Task.WaitAll(Enumerable.Range(0, 5) .Select(_ => CanSendLightningPaymentCore(tester, user)) @@ -586,7 +567,10 @@ namespace BTCPayServer.Tests async Task CanSendLightningPaymentCore(ServerTester tester, TestAccount user) { - await Task.Delay(TimeSpan.FromSeconds(RandomUtils.GetUInt32() % 5)); + // TODO: If this parameter is less than 1 second we start having concurrency problems + await Task.Delay(TimeSpan.FromMilliseconds(1000)); + // + var invoice = await user.BitPay.CreateInvoiceAsync(new Invoice() { Price = 0.01m, diff --git a/BTCPayServer.Tests/UnitTestPeusa.cs b/BTCPayServer.Tests/UnitTestPeusa.cs new file mode 100644 index 000000000..14b4e3717 --- /dev/null +++ b/BTCPayServer.Tests/UnitTestPeusa.cs @@ -0,0 +1,48 @@ +using System; +using NBitcoin; +using Xunit; + +namespace BTCPayServer.Tests +{ + // Helper class for testing functionality and generating data needed during coding/debuging + public class UnitTestPeusa + { + // Unit test that generates temorary checkout Bitpay page + // https://forkbitpay.slack.com/archives/C7M093Z55/p1508293682000217 + + // Testnet of Bitpay down + //[Fact] + //public void BitpayCheckout() + //{ + // var key = new Key(Encoders.Hex.DecodeData("7b70a06f35562873e3dcb46005ed0fe78e1991ad906e56adaaafa40ba861e056")); + // var url = new Uri("https://test.bitpay.com/"); + // var btcpay = new Bitpay(key, url); + // var invoice = btcpay.CreateInvoice(new Invoice() + // { + + // Price = 5.0, + // Currency = "USD", + // PosData = "posData", + // OrderId = "cdfd8a5f-6928-4c3b-ba9b-ddf438029e73", + // ItemDesc = "Hello from the otherside" + // }, Facade.Merchant); + + // // go to invoice.Url + // Console.WriteLine(invoice.Url); + //} + + // Generating Extended public key to use on http://localhost:14142/stores/{storeId} + [Fact] + public void GeneratePubkey() + { + var network = Network.RegTest; + + ExtKey masterKey = new ExtKey(); + Console.WriteLine("Master key : " + masterKey.ToString(network)); + ExtPubKey masterPubKey = masterKey.Neuter(); + + ExtPubKey pubkey = masterPubKey.Derive(0); + Console.WriteLine("PubKey " + 0 + " : " + pubkey.ToString(network)); + } + } +} diff --git a/BTCPayServer.Tests/docker-compose.yml b/BTCPayServer.Tests/docker-compose.yml index 81fec0eeb..310d77645 100644 --- a/BTCPayServer.Tests/docker-compose.yml +++ b/BTCPayServer.Tests/docker-compose.yml @@ -20,6 +20,7 @@ services: TEST_MERCHANTLIGHTNINGD: "type=clightning;server=/etc/merchant_lightningd_datadir/lightning-rpc" TEST_CUSTOMERLIGHTNINGD: "type=clightning;server=/etc/customer_lightningd_datadir/lightning-rpc" TEST_MERCHANTCHARGE: "type=charge;server=http://lightning-charged:9112/;api-token=foiewnccewuify" + TEST_MERCHANTLND: "type=lnd;server=http://lnd:lnd@127.0.0.1:53280/" TESTS_INCONTAINER: "true" expose: - "80" @@ -44,6 +45,22 @@ services: - customer_lightningd - merchant_lightningd - lightning-charged + - customer_lnd + - merchant_lnd + + devlnd: + image: nicolasdorier/docker-bitcoin:0.16.0 + environment: + BITCOIN_EXTRA_ARGS: | + regtest=1 + connect=bitcoind:39388 + links: + - nbxplorer + - postgres + - customer_lnd + - merchant_lnd + + nbxplorer: image: nicolasdorier/nbxplorer:1.0.2.8 @@ -80,8 +97,13 @@ services: rpcport=43782 port=39388 whitelist=0.0.0.0/0 + zmqpubrawtx=tcp://0.0.0.0:28332 + zmqpubrawblock=tcp://0.0.0.0:28332 + zmqpubrawtxlock=tcp://0.0.0.0:28332 + zmqpubhashblock=tcp://0.0.0.0:28332 ports: - "43782:43782" + - "28332:28332" expose: - "43782" # RPC - "39388" # P2P @@ -177,8 +199,52 @@ services: expose: - "5432" + merchant_lnd: + image: btcpayserver/lnd:0.4.2.0 + environment: + RPCHOST: bitcoind:43782 + RPCUSER: ceiwHEbqWI83 + RPCPASS: DwubwWsoo3 + ZMQPATH: tcp://bitcoind:28332 + NETWORK: regtest + CHAIN: bitcoin + BACKEND: bitcoind + DEBUG: debug + EXTERNALIP: merchant_lnd:9735 + ports: + - "53280:8080" + expose: + - "9735" + volumes: + - "merchant_lnd_datadir:/root/.lnd" + links: + - bitcoind + + customer_lnd: + image: btcpayserver/lnd:0.4.2.0 + environment: + RPCHOST: bitcoind:43782 + RPCUSER: ceiwHEbqWI83 + RPCPASS: DwubwWsoo3 + ZMQPATH: tcp://bitcoind:28332 + NETWORK: regtest + CHAIN: bitcoin + BACKEND: bitcoind + DEBUG: debug + ports: + - "53281:8080" + expose: + - "8080" + - "10009" + volumes: + - "customer_lnd_datadir:/root/.lnd" + links: + - bitcoind + volumes: bitcoin_datadir: customer_lightningd_datadir: merchant_lightningd_datadir: lightning_charge_datadir: + customer_lnd_datadir: + merchant_lnd_datadir: diff --git a/BTCPayServer/Configuration/BTCPayServerOptions.cs b/BTCPayServer/Configuration/BTCPayServerOptions.cs index db9760412..9a8fca5f0 100644 --- a/BTCPayServer/Configuration/BTCPayServerOptions.cs +++ b/BTCPayServer/Configuration/BTCPayServerOptions.cs @@ -81,7 +81,8 @@ namespace BTCPayServer.Configuration { throw new ConfigException($"Invalid setting {net.CryptoCode}.lightning, " + Environment.NewLine + $"If you have a lightning server use: 'type=clightning;server=/root/.lightning/lightning-rpc', " + Environment.NewLine + - $"If you have a lightning charge server: 'type=charge;server=https://charge.example.com;api-token=yourapitoken'"); + $"If you have a lightning charge server: 'type=charge;server=https://charge.example.com;api-token=yourapitoken'" + Environment.NewLine + + $"If you have a lnd server: 'type=lnd;server=https://lnd:lnd@lnd.example.com;macaron=abf239...;tls=2abdf302...'"); } if(connectionString.IsLegacy) { diff --git a/BTCPayServer/Controllers/StoresController.LightningLike.cs b/BTCPayServer/Controllers/StoresController.LightningLike.cs index eb2859277..68df0e884 100644 --- a/BTCPayServer/Controllers/StoresController.LightningLike.cs +++ b/BTCPayServer/Controllers/StoresController.LightningLike.cs @@ -35,7 +35,6 @@ namespace BTCPayServer.Controllers { vm.ConnectionString = GetExistingLightningSupportedPaymentMethod(vm.CryptoCode, store)?.GetLightningUrl()?.ToString(); } - private LightningSupportedPaymentMethod GetExistingLightningSupportedPaymentMethod(string cryptoCode, StoreData store) { var id = new PaymentMethodId(cryptoCode, PaymentTypes.LightningLike); @@ -82,7 +81,7 @@ namespace BTCPayServer.Controllers return View(vm); } - var internalDomain = internalLightning?.ToUri(false)?.DnsSafeHost; + var internalDomain = internalLightning.BaseUri?.DnsSafeHost; bool isLocal = (internalDomain == "127.0.0.1" || internalDomain == "localhost"); bool isInternalNode = connectionString.ConnectionType == LightningConnectionType.CLightning || @@ -110,6 +109,7 @@ namespace BTCPayServer.Controllers }; paymentMethod.SetLightningUrl(connectionString); } + if (command == "save") { store.SetSupportedPaymentMethod(paymentMethodId, paymentMethod); @@ -135,7 +135,7 @@ namespace BTCPayServer.Controllers await handler.TestConnection(info, cts.Token); } } - vm.StatusMessage = $"Connection to the lightning node succeed ({info})"; + vm.StatusMessage = $"Connection to the lightning node succeeded ({info})"; } catch (Exception ex) { diff --git a/BTCPayServer/Payments/Lightning/LightningClientFactory.cs b/BTCPayServer/Payments/Lightning/LightningClientFactory.cs index 5314f7255..bc0fae360 100644 --- a/BTCPayServer/Payments/Lightning/LightningClientFactory.cs +++ b/BTCPayServer/Payments/Lightning/LightningClientFactory.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using BTCPayServer.Payments.Lightning.Charge; using BTCPayServer.Payments.Lightning.CLightning; using NBitcoin; +using BTCPayServer.Payments.Lightning.Lnd; namespace BTCPayServer.Payments.Lightning { @@ -16,18 +17,24 @@ namespace BTCPayServer.Payments.Lightning return CreateClient(uri, network.NBitcoinNetwork); } - public static ILightningInvoiceClient CreateClient(LightningConnectionString uri, Network network) + public static ILightningInvoiceClient CreateClient(LightningConnectionString connString, Network network) { - if (uri.ConnectionType == LightningConnectionType.Charge) + if (connString.ConnectionType == LightningConnectionType.Charge) { - return new ChargeClient(uri.ToUri(true), network); + return new ChargeClient(connString.ToUri(true), network); } - else if (uri.ConnectionType == LightningConnectionType.CLightning) + else if (connString.ConnectionType == LightningConnectionType.CLightning) { - return new CLightningRPCClient(uri.ToUri(false), network); + return new CLightningRPCClient(connString.ToUri(false), network); + + } + else if (connString.ConnectionType == LightningConnectionType.Lnd) + { + var swagger = LndSwaggerClientCustomHttp.Create(connString.BaseUri, network, connString.Tls, connString.Macaroon); + return new LndInvoiceClient(swagger); } else - throw new NotSupportedException($"Unsupported connection string for lightning server ({uri.ConnectionType})"); + throw new NotSupportedException($"Unsupported connection string for lightning server ({connString.ConnectionType})"); } public static ILightningInvoiceClient CreateClient(string connectionString, Network network) diff --git a/BTCPayServer/Payments/Lightning/LightningConnectionString.cs b/BTCPayServer/Payments/Lightning/LightningConnectionString.cs index 82871c7f5..9574af49b 100644 --- a/BTCPayServer/Payments/Lightning/LightningConnectionString.cs +++ b/BTCPayServer/Payments/Lightning/LightningConnectionString.cs @@ -3,13 +3,17 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.WebUtilities; +using Microsoft.Extensions.Primitives; namespace BTCPayServer.Payments.Lightning { public enum LightningConnectionType { Charge, - CLightning + CLightning, + Lnd } public class LightningConnectionString { @@ -20,6 +24,7 @@ namespace BTCPayServer.Payments.Lightning typeMapping = new Dictionary(); typeMapping.Add("clightning", LightningConnectionType.CLightning); typeMapping.Add("charge", LightningConnectionType.Charge); + typeMapping.Add("lnd", LightningConnectionType.Lnd); typeMappingReverse = new Dictionary(); foreach (var kv in typeMapping) { @@ -153,6 +158,56 @@ namespace BTCPayServer.Payments.Lightning result.BaseUri = uri; } break; + case LightningConnectionType.Lnd: + { + var server = Take(keyValues, "server"); + if (server == null) + { + error = $"The key 'server' is mandatory for lnd connection strings"; + return false; + } + if (!Uri.TryCreate(server, UriKind.Absolute, out var uri) + || (uri.Scheme != "http" && uri.Scheme != "https")) + { + error = $"The key 'server' should be an URI starting by http:// or https://"; + return false; + } + parts = uri.UserInfo.Split(':'); + if (!string.IsNullOrEmpty(uri.UserInfo) && parts.Length == 2) + { + result.Username = parts[0]; + result.Password = parts[1]; + } + result.BaseUri = new UriBuilder(uri) { UserName = "", Password = "" }.Uri; + + var macaroon = Take(keyValues, "macaroon"); + //if(macaroon == null) + //{ + // error = $"The key 'macaroon' is mandatory for lnd connection strings"; + // return false; + //} + //try + //{ + // result.Macaroon = Encoder.DecodeData(macaroon); + //} + //catch + //{ + // error = $"The key 'macaroon' format should be in hex"; + // return false; + //} + try + { + var tls = Take(keyValues, "tls"); + if (tls != null) + result.Tls = Encoder.DecodeData(tls); + } + catch + { + error = $"The key 'tls' format should be in hex"; + return false; + } + } + break; default: throw new NotSupportedException(connectionType.ToString()); } @@ -182,7 +237,7 @@ namespace BTCPayServer.Payments.Lightning error = null; Uri uri; - if (!System.Uri.TryCreate(str, UriKind.Absolute, out uri)) + if (!Uri.TryCreate(str, UriKind.Absolute, out uri)) { error = "Invalid URL"; return false; @@ -195,7 +250,6 @@ namespace BTCPayServer.Payments.Lightning error = $"The url support the following protocols {protocols}"; return false; } - if (uri.Scheme == "unix") { str = uri.AbsoluteUri.Substring("unix:".Length); @@ -248,6 +302,8 @@ namespace BTCPayServer.Payments.Lightning get; private set; } + public byte[] Macaroon { get; set; } + public byte[] Tls { get; set; } public Uri ToUri(bool withCredentials) { @@ -260,7 +316,7 @@ namespace BTCPayServer.Payments.Lightning return BaseUri; } } - + static NBitcoin.DataEncoders.DataEncoder Encoder = NBitcoin.DataEncoders.Encoders.Hex; public override string ToString() { var type = typeMappingReverse[ConnectionType]; @@ -269,7 +325,7 @@ namespace BTCPayServer.Payments.Lightning switch (ConnectionType) { case LightningConnectionType.Charge: - if(Username == null || Username == "api-token") + if (Username == null || Username == "api-token") { builder.Append($";server={BaseUri};api-token={Password}"); } @@ -281,6 +337,24 @@ namespace BTCPayServer.Payments.Lightning case LightningConnectionType.CLightning: builder.Append($";server={BaseUri}"); break; + case LightningConnectionType.Lnd: + if (Username == null) + { + builder.Append($";server={BaseUri}"); + } + else + { + builder.Append($";server={ToUri(true)}"); + } + if (Macaroon != null) + { + builder.Append($";macaroon={Encoder.EncodeData(Macaroon)}"); + } + if (Tls != null) + { + builder.Append($";tls={Encoder.EncodeData(Tls)}"); + } + break; default: throw new NotSupportedException(type); } diff --git a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs index 76fc5cb18..9b871d2ad 100644 --- a/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs +++ b/BTCPayServer/Payments/Lightning/LightningLikePaymentHandler.cs @@ -15,6 +15,8 @@ namespace BTCPayServer.Payments.Lightning { public class LightningLikePaymentHandler : PaymentMethodHandlerBase { + public static int LIGHTNING_TIMEOUT = 5000; + NBXplorerDashboard _Dashboard; LightningClientFactory _LightningClientFactory; public LightningLikePaymentHandler( @@ -41,7 +43,7 @@ namespace BTCPayServer.Payments.Lightning description = description.Replace("{StoreName}", store.StoreName ?? "", StringComparison.OrdinalIgnoreCase) .Replace("{ItemDescription}", invoice.ProductInformation.ItemDesc ?? "", StringComparison.OrdinalIgnoreCase) .Replace("{OrderId}", invoice.OrderId ?? "", StringComparison.OrdinalIgnoreCase); - using (var cts = new CancellationTokenSource(5000)) + using (var cts = new CancellationTokenSource(LIGHTNING_TIMEOUT)) { try { @@ -70,7 +72,7 @@ namespace BTCPayServer.Payments.Lightning if (!_Dashboard.IsFullySynched(network.CryptoCode, out var summary)) throw new PaymentMethodUnavailableException($"Full node not available"); - using (var cts = new CancellationTokenSource(5000)) + using (var cts = new CancellationTokenSource(LIGHTNING_TIMEOUT)) { var client = _LightningClientFactory.CreateClient(supportedPaymentMethod, network); LightningNodeInformation info = null; diff --git a/BTCPayServer/Payments/Lightning/LightningSupportedPaymentMethod.cs b/BTCPayServer/Payments/Lightning/LightningSupportedPaymentMethod.cs index 4c7e8a2ab..cb6e41358 100644 --- a/BTCPayServer/Payments/Lightning/LightningSupportedPaymentMethod.cs +++ b/BTCPayServer/Payments/Lightning/LightningSupportedPaymentMethod.cs @@ -8,6 +8,15 @@ namespace BTCPayServer.Payments.Lightning public class LightningSupportedPaymentMethod : ISupportedPaymentMethod { public string CryptoCode { get; set; } + + [Obsolete("Use Get/SetLightningUrl")] + public string Username { get; set; } + [Obsolete("Use Get/SetLightningUrl")] + public string Password { get; set; } + + // This property MUST be after CryptoCode or else JSON serialization fails + public PaymentMethodId PaymentId => new PaymentMethodId(CryptoCode, PaymentTypes.LightningLike); + [Obsolete("Use Get/SetLightningUrl")] public string LightningChargeUrl { get; set; } @@ -49,11 +58,5 @@ namespace BTCPayServer.Payments.Lightning LightningChargeUrl = null; #pragma warning restore CS0618 // Type or member is obsolete } - - [Obsolete("Use Get/SetLightningUrl")] - public string Username { get; set; } - [Obsolete("Use Get/SetLightningUrl")] - public string Password { get; set; } - public PaymentMethodId PaymentId => new PaymentMethodId(CryptoCode, PaymentTypes.LightningLike); } } diff --git a/BTCPayServer/Payments/Lightning/Lnd/LndInvoiceClient.cs b/BTCPayServer/Payments/Lightning/Lnd/LndInvoiceClient.cs new file mode 100644 index 000000000..3f1771a5b --- /dev/null +++ b/BTCPayServer/Payments/Lightning/Lnd/LndInvoiceClient.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using NBitcoin; + +namespace BTCPayServer.Payments.Lightning.Lnd +{ + public class LndInvoiceClient : ILightningInvoiceClient, ILightningListenInvoiceSession + { + public LndSwaggerClient _rpcClient; + + public LndInvoiceClient(LndSwaggerClient rpcClient) + { + _rpcClient = rpcClient; + } + + public async Task CreateInvoice(LightMoney amount, string description, TimeSpan expiry, + CancellationToken cancellation = default(CancellationToken)) + { + var strAmount = ConvertInv.ToString(amount.ToUnit(LightMoneyUnit.Satoshi)); + var strExpiry = ConvertInv.ToString(Math.Round(expiry.TotalSeconds, 0)); + // lnd requires numbers sent as strings. don't ask + var resp = await _rpcClient.AddInvoiceAsync(new LnrpcInvoice + { + Value = strAmount, + Memo = description, + Expiry = strExpiry + }); + + var invoice = new LightningInvoice + { + Id = BitString(resp.R_hash), + Amount = amount, + BOLT11 = resp.Payment_request, + Status = "unpaid" + }; + return invoice; + } + + public async Task GetInfo(CancellationToken cancellation = default(CancellationToken)) + { + var resp = await _rpcClient.GetInfoAsync(cancellation); + + var nodeInfo = new LightningNodeInformation + { + BlockHeight = (int?)resp.Block_height ?? 0, + NodeId = resp.Identity_pubkey + }; + + + var node = await _rpcClient.GetNodeInfoAsync(resp.Identity_pubkey, cancellation); + if (node.Node.Addresses == null || node.Node.Addresses.Count == 0) + throw new Exception("Lnd External IP not set, make sure you use --externalip=$EXTERNALIP parameter on lnd"); + + var firstNodeInfo = node.Node.Addresses.First(); + var externalHostPort = firstNodeInfo.Addr.Split(':'); + + nodeInfo.Address = externalHostPort[0]; + nodeInfo.P2PPort = ConvertInv.ToInt32(externalHostPort[1]); + + return nodeInfo; + } + + public async Task GetInvoice(string invoiceId, CancellationToken cancellation = default(CancellationToken)) + { + var resp = await _rpcClient.LookupInvoiceAsync(invoiceId, null, cancellation); + return ConvertLndInvoice(resp); + } + + public Task Listen(CancellationToken cancellation = default(CancellationToken)) + { +#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed + _rpcClient.StartSubscribeInvoiceThread(cancellation); +#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed + return Task.FromResult(this); + } + + async Task ILightningListenInvoiceSession.WaitInvoice(CancellationToken cancellation) + { + var resp = await _rpcClient.InvoiceResponse.Task; + return ConvertLndInvoice(resp); + } + + + // utility static methods... maybe move to separate class + private static string BitString(byte[] bytes) + { + return BitConverter.ToString(bytes) + .Replace("-", "", StringComparison.InvariantCulture) + .ToLower(CultureInfo.InvariantCulture); + } + + private static LightningInvoice ConvertLndInvoice(LnrpcInvoice resp) + { + var invoice = new LightningInvoice + { + // TODO: Verify id corresponds to R_hash + Id = BitString(resp.R_hash), + Amount = new LightMoney(ConvertInv.ToInt64(resp.Value), LightMoneyUnit.Satoshi), + BOLT11 = resp.Payment_request, + Status = "unpaid" + }; + + if (resp.Settle_date != null) + { + invoice.PaidAt = DateTimeOffset.FromUnixTimeSeconds(ConvertInv.ToInt64(resp.Settle_date)); + invoice.Status = "paid"; + } + else + { + var invoiceExpiry = ConvertInv.ToInt64(resp.Creation_date) + ConvertInv.ToInt64(resp.Expiry); + if (DateTimeOffset.FromUnixTimeSeconds(invoiceExpiry) > DateTimeOffset.UtcNow) + { + invoice.Status = "expired"; + } + } + return invoice; + } + + public void Dispose() + { + // + } + + // Invariant culture conversion + public static class ConvertInv + { + public static int ToInt32(string str) + { + return Convert.ToInt32(str, CultureInfo.InvariantCulture.NumberFormat); + } + + public static long ToInt64(string str) + { + return Convert.ToInt64(str, CultureInfo.InvariantCulture.NumberFormat); + } + + public static string ToString(decimal d) + { + return d.ToString(CultureInfo.InvariantCulture); + } + + public static string ToString(double d) + { + return d.ToString(CultureInfo.InvariantCulture); + } + } + } +} diff --git a/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClient.cs b/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClient.cs new file mode 100644 index 000000000..c59793b8d --- /dev/null +++ b/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClient.cs @@ -0,0 +1,8725 @@ +//---------------------- +// +// Generated using the NSwag toolchain v11.11.1.0 (NJsonSchema v9.9.11.0 (Newtonsoft.Json v9.0.0.0)) (http://NSwag.org) +// +//---------------------- + +using System.Diagnostics; + +namespace BTCPayServer.Payments.Lightning.Lnd +{ + #pragma warning disable // Disable all warnings + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.11.1.0")] + partial class LndSwaggerClient + { + private System.Lazy _settings; + private string _baseUrl = ""; + + private System.Net.Http.HttpClient _httpClient; + + public LndSwaggerClient(string baseUrl, System.Net.Http.HttpClient httpClient) + { + BaseUrl = baseUrl; + _httpClient = httpClient; + _settings = new System.Lazy(() => + { + var settings = new Newtonsoft.Json.JsonSerializerSettings(); + UpdateJsonSerializerSettings(settings); + return settings; + }); + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// * lncli: `walletbalance` + /// WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + /// confirmed unspent outputs and all unconfirmed unspent outputs under control + /// of the wallet. + /// A server side error occurred. + public System.Threading.Tasks.Task WalletBalanceAsync() + { + return WalletBalanceAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `walletbalance` + /// WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + /// confirmed unspent outputs and all unconfirmed unspent outputs under control + /// of the wallet. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task WalletBalanceAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/balance/blockchain"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcWalletBalanceResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcWalletBalanceResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `channelbalance` + /// ChannelBalance returns the total funds available across all open channels + /// in satoshis. + /// A server side error occurred. + public System.Threading.Tasks.Task ChannelBalanceAsync() + { + return ChannelBalanceAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `channelbalance` + /// ChannelBalance returns the total funds available across all open channels + /// in satoshis. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ChannelBalanceAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/balance/channels"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcChannelBalanceResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcChannelBalanceResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `listchannels` + /// ListChannels returns a description of all the open channels that this node + /// is a participant in. + /// A server side error occurred. + public System.Threading.Tasks.Task ListChannelsAsync(bool? active_only, bool? inactive_only, bool? public_only, bool? private_only) + { + return ListChannelsAsync(active_only, inactive_only, public_only, private_only, System.Threading.CancellationToken.None); + } + + /// * lncli: `listchannels` + /// ListChannels returns a description of all the open channels that this node + /// is a participant in. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ListChannelsAsync(bool? active_only, bool? inactive_only, bool? public_only, bool? private_only, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/channels?"); + if (active_only != null) urlBuilder_.Append("active_only=").Append(System.Uri.EscapeDataString(System.Convert.ToString(active_only.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (inactive_only != null) urlBuilder_.Append("inactive_only=").Append(System.Uri.EscapeDataString(System.Convert.ToString(inactive_only.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (public_only != null) urlBuilder_.Append("public_only=").Append(System.Uri.EscapeDataString(System.Convert.ToString(public_only.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (private_only != null) urlBuilder_.Append("private_only=").Append(System.Uri.EscapeDataString(System.Convert.ToString(private_only.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcListChannelsResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcListChannelsResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + /// call is meant to be consumed by clients to the REST proxy. As with all + /// other sync calls, all byte slices are intended to be populated as hex + /// encoded strings. + /// A server side error occurred. + public System.Threading.Tasks.Task OpenChannelSyncAsync(LnrpcOpenChannelRequest body) + { + return OpenChannelSyncAsync(body, System.Threading.CancellationToken.None); + } + + /// * + /// OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + /// call is meant to be consumed by clients to the REST proxy. As with all + /// other sync calls, all byte slices are intended to be populated as hex + /// encoded strings. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task OpenChannelSyncAsync(LnrpcOpenChannelRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/channels"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcChannelPoint); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcChannelPoint); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `pendingchannels` + /// PendingChannels returns a list of all the channels that are currently + /// considered "pending". A channel is pending if it has finished the funding + /// workflow and is waiting for confirmations for the funding txn, or is in the + /// process of closure, either initiated cooperatively or non-cooperatively. + /// A server side error occurred. + public System.Threading.Tasks.Task PendingChannelsAsync() + { + return PendingChannelsAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `pendingchannels` + /// PendingChannels returns a list of all the channels that are currently + /// considered "pending". A channel is pending if it has finished the funding + /// workflow and is waiting for confirmations for the funding txn, or is in the + /// process of closure, either initiated cooperatively or non-cooperatively. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task PendingChannelsAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/channels/pending"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcPendingChannelsResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcPendingChannelsResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// SendPaymentSync is the synchronous non-streaming version of SendPayment. + /// This RPC is intended to be consumed by clients of the REST proxy. + /// Additionally, this RPC expects the destination's public key and the payment + /// hash (if any) to be encoded as hex strings. + /// A server side error occurred. + public System.Threading.Tasks.Task SendPaymentSyncAsync(LnrpcSendRequest body) + { + return SendPaymentSyncAsync(body, System.Threading.CancellationToken.None); + } + + /// * + /// SendPaymentSync is the synchronous non-streaming version of SendPayment. + /// This RPC is intended to be consumed by clients of the REST proxy. + /// Additionally, this RPC expects the destination's public key and the payment + /// hash (if any) to be encoded as hex strings. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task SendPaymentSyncAsync(LnrpcSendRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/channels/transactions"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcSendResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcSendResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `closechannel` + /// CloseChannel attempts to close an active channel identified by its channel + /// outpoint (ChannelPoint). The actions of this method can additionally be + /// augmented to attempt a force close after a timeout period in the case of an + /// inactive peer. If a non-force close (cooperative closure) is requested, + /// then the user can specify either a target number of blocks until the + /// closure transaction is confirmed, or a manual fee rate. If neither are + /// specified, then a default lax, block confirmation target is used. + /// (streaming responses) + /// A server side error occurred. + public System.Threading.Tasks.Task CloseChannelAsync(string channel_point_funding_txid_str, long channel_point_output_index) + { + return CloseChannelAsync(channel_point_funding_txid_str, channel_point_output_index, System.Threading.CancellationToken.None); + } + + /// * lncli: `closechannel` + /// CloseChannel attempts to close an active channel identified by its channel + /// outpoint (ChannelPoint). The actions of this method can additionally be + /// augmented to attempt a force close after a timeout period in the case of an + /// inactive peer. If a non-force close (cooperative closure) is requested, + /// then the user can specify either a target number of blocks until the + /// closure transaction is confirmed, or a manual fee rate. If neither are + /// specified, then a default lax, block confirmation target is used. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// (streaming responses) + /// A server side error occurred. + public async System.Threading.Tasks.Task CloseChannelAsync(string channel_point_funding_txid_str, long channel_point_output_index, System.Threading.CancellationToken cancellationToken) + { + if (channel_point_funding_txid_str == null) + throw new System.ArgumentNullException("channel_point_funding_txid_str"); + + if (channel_point_output_index == null) + throw new System.ArgumentNullException("channel_point_output_index"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}"); + urlBuilder_.Replace("{channel_point.funding_txid_str}", System.Uri.EscapeDataString(System.Convert.ToString(channel_point_funding_txid_str, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{channel_point.output_index}", System.Uri.EscapeDataString(System.Convert.ToString(channel_point_output_index, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcCloseStatusUpdate); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcCloseStatusUpdate); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `updatechanpolicy` + /// UpdateChannelPolicy allows the caller to update the fee schedule and + /// channel policies for all channels globally, or a particular channel. + /// A server side error occurred. + public System.Threading.Tasks.Task UpdateChannelPolicyAsync(LnrpcPolicyUpdateRequest body) + { + return UpdateChannelPolicyAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `updatechanpolicy` + /// UpdateChannelPolicy allows the caller to update the fee schedule and + /// channel policies for all channels globally, or a particular channel. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task UpdateChannelPolicyAsync(LnrpcPolicyUpdateRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/chanpolicy"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `feereport` + /// FeeReport allows the caller to obtain a report detailing the current fee + /// schedule enforced by the node globally for each channel. + /// A server side error occurred. + public System.Threading.Tasks.Task FeeReportAsync() + { + return FeeReportAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `feereport` + /// FeeReport allows the caller to obtain a report detailing the current fee + /// schedule enforced by the node globally for each channel. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task FeeReportAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/fees"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcFeeReportResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcFeeReportResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// GenSeed is the first method that should be used to instantiate a new lnd + /// instance. This method allows a caller to generate a new aezeed cipher seed + /// given an optional passphrase. If provided, the passphrase will be necessary + /// to decrypt the cipherseed to expose the internal wallet seed. + /// * + /// aezeed_passphrase is an optional user provided passphrase that will be used + /// to encrypt the generated aezeed cipher seed. + /// * + /// seed_entropy is an optional 16-bytes generated via CSPRNG. If not + /// specified, then a fresh set of randomness will be used to create the seed. + /// A server side error occurred. + public System.Threading.Tasks.Task GenSeedAsync(byte[] aezeed_passphrase, byte[] seed_entropy) + { + return GenSeedAsync(aezeed_passphrase, seed_entropy, System.Threading.CancellationToken.None); + } + + /// * + /// GenSeed is the first method that should be used to instantiate a new lnd + /// instance. This method allows a caller to generate a new aezeed cipher seed + /// given an optional passphrase. If provided, the passphrase will be necessary + /// to decrypt the cipherseed to expose the internal wallet seed. + /// * + /// aezeed_passphrase is an optional user provided passphrase that will be used + /// to encrypt the generated aezeed cipher seed. + /// * + /// seed_entropy is an optional 16-bytes generated via CSPRNG. If not + /// specified, then a fresh set of randomness will be used to create the seed. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GenSeedAsync(byte[] aezeed_passphrase, byte[] seed_entropy, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/genseed?"); + if (aezeed_passphrase != null) urlBuilder_.Append("aezeed_passphrase=").Append(System.Uri.EscapeDataString(System.Convert.ToString(aezeed_passphrase, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + if (seed_entropy != null) urlBuilder_.Append("seed_entropy=").Append(System.Uri.EscapeDataString(System.Convert.ToString(seed_entropy, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcGenSeedResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcGenSeedResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `getinfo` + /// GetInfo returns general information concerning the lightning node including + /// it's identity pubkey, alias, the chains it is connected to, and information + /// concerning the number of open+pending channels. + /// A server side error occurred. + public System.Threading.Tasks.Task GetInfoAsync() + { + return GetInfoAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `getinfo` + /// GetInfo returns general information concerning the lightning node including + /// it's identity pubkey, alias, the chains it is connected to, and information + /// concerning the number of open+pending channels. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GetInfoAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/getinfo"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcGetInfoResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcGetInfoResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `describegraph` + /// DescribeGraph returns a description of the latest graph state from the + /// point of view of the node. The graph information is partitioned into two + /// components: all the nodes/vertexes, and all the edges that connect the + /// vertexes themselves. As this is a directed graph, the edges also contain + /// the node directional specific routing policy which includes: the time lock + /// delta, fee information, etc. + /// A server side error occurred. + public System.Threading.Tasks.Task DescribeGraphAsync() + { + return DescribeGraphAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `describegraph` + /// DescribeGraph returns a description of the latest graph state from the + /// point of view of the node. The graph information is partitioned into two + /// components: all the nodes/vertexes, and all the edges that connect the + /// vertexes themselves. As this is a directed graph, the edges also contain + /// the node directional specific routing policy which includes: the time lock + /// delta, fee information, etc. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task DescribeGraphAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/graph"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcChannelGraph); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcChannelGraph); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `getchaninfo` + /// GetChanInfo returns the latest authenticated network announcement for the + /// given channel identified by its channel ID: an 8-byte integer which + /// uniquely identifies the location of transaction's funding output within the + /// blockchain. + /// A server side error occurred. + public System.Threading.Tasks.Task GetChanInfoAsync(string chan_id) + { + return GetChanInfoAsync(chan_id, System.Threading.CancellationToken.None); + } + + /// * lncli: `getchaninfo` + /// GetChanInfo returns the latest authenticated network announcement for the + /// given channel identified by its channel ID: an 8-byte integer which + /// uniquely identifies the location of transaction's funding output within the + /// blockchain. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GetChanInfoAsync(string chan_id, System.Threading.CancellationToken cancellationToken) + { + if (chan_id == null) + throw new System.ArgumentNullException("chan_id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/graph/edge/{chan_id}"); + urlBuilder_.Replace("{chan_id}", System.Uri.EscapeDataString(System.Convert.ToString(chan_id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcChannelEdge); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcChannelEdge); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `getnetworkinfo` + /// GetNetworkInfo returns some basic stats about the known channel graph from + /// the point of view of the node. + /// A server side error occurred. + public System.Threading.Tasks.Task GetNetworkInfoAsync() + { + return GetNetworkInfoAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `getnetworkinfo` + /// GetNetworkInfo returns some basic stats about the known channel graph from + /// the point of view of the node. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GetNetworkInfoAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/graph/info"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcNetworkInfo); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcNetworkInfo); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `getnodeinfo` + /// GetNodeInfo returns the latest advertised, aggregated, and authenticated + /// channel information for the specified node identified by its public key. + /// A server side error occurred. + public System.Threading.Tasks.Task GetNodeInfoAsync(string pub_key) + { + return GetNodeInfoAsync(pub_key, System.Threading.CancellationToken.None); + } + + /// * lncli: `getnodeinfo` + /// GetNodeInfo returns the latest advertised, aggregated, and authenticated + /// channel information for the specified node identified by its public key. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GetNodeInfoAsync(string pub_key, System.Threading.CancellationToken cancellationToken) + { + if (pub_key == null) + throw new System.ArgumentNullException("pub_key"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/graph/node/{pub_key}"); + urlBuilder_.Replace("{pub_key}", System.Uri.EscapeDataString(System.Convert.ToString(pub_key, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcNodeInfo); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcNodeInfo); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `queryroutes` + /// QueryRoutes attempts to query the daemon's Channel Router for a possible + /// route to a target destination capable of carrying a specific amount of + /// satoshis. The retuned route contains the full details required to craft and + /// send an HTLC, also including the necessary information that should be + /// present within the Sphinx packet encapsulated within the HTLC. + /// / The max number of routes to return. + /// A server side error occurred. + public System.Threading.Tasks.Task QueryRoutesAsync(string pub_key, string amt, int? num_routes) + { + return QueryRoutesAsync(pub_key, amt, num_routes, System.Threading.CancellationToken.None); + } + + /// * lncli: `queryroutes` + /// QueryRoutes attempts to query the daemon's Channel Router for a possible + /// route to a target destination capable of carrying a specific amount of + /// satoshis. The retuned route contains the full details required to craft and + /// send an HTLC, also including the necessary information that should be + /// present within the Sphinx packet encapsulated within the HTLC. + /// / The max number of routes to return. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task QueryRoutesAsync(string pub_key, string amt, int? num_routes, System.Threading.CancellationToken cancellationToken) + { + if (pub_key == null) + throw new System.ArgumentNullException("pub_key"); + + if (amt == null) + throw new System.ArgumentNullException("amt"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/graph/routes/{pub_key}/{amt}?"); + urlBuilder_.Replace("{pub_key}", System.Uri.EscapeDataString(System.Convert.ToString(pub_key, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{amt}", System.Uri.EscapeDataString(System.Convert.ToString(amt, System.Globalization.CultureInfo.InvariantCulture))); + if (num_routes != null) urlBuilder_.Append("num_routes=").Append(System.Uri.EscapeDataString(System.Convert.ToString(num_routes.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcQueryRoutesResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcQueryRoutesResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// InitWallet is used when lnd is starting up for the first time to fully + /// initialize the daemon and its internal wallet. At the very least a wallet + /// password must be provided. This will be used to encrypt sensitive material + /// on disk. + /// A server side error occurred. + public System.Threading.Tasks.Task InitWalletAsync(LnrpcInitWalletRequest body) + { + return InitWalletAsync(body, System.Threading.CancellationToken.None); + } + + /// * + /// InitWallet is used when lnd is starting up for the first time to fully + /// initialize the daemon and its internal wallet. At the very least a wallet + /// password must be provided. This will be used to encrypt sensitive material + /// on disk. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task InitWalletAsync(LnrpcInitWalletRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/initwallet"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `lookupinvoice` + /// LookupInvoice attempts to look up an invoice according to its payment hash. + /// The passed payment hash *must* be exactly 32 bytes, if not, an error is + /// returned. + /// / The payment hash of the invoice to be looked up. + /// A server side error occurred. + public System.Threading.Tasks.Task LookupInvoiceAsync(string r_hash_str, byte[] r_hash) + { + return LookupInvoiceAsync(r_hash_str, r_hash, System.Threading.CancellationToken.None); + } + + /// * lncli: `lookupinvoice` + /// LookupInvoice attempts to look up an invoice according to its payment hash. + /// The passed payment hash *must* be exactly 32 bytes, if not, an error is + /// returned. + /// / The payment hash of the invoice to be looked up. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task LookupInvoiceAsync(string r_hash_str, byte[] r_hash, System.Threading.CancellationToken cancellationToken) + { + if (r_hash_str == null) + throw new System.ArgumentNullException("r_hash_str"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/invoice/{r_hash_str}?"); + urlBuilder_.Replace("{r_hash_str}", System.Uri.EscapeDataString(System.Convert.ToString(r_hash_str, System.Globalization.CultureInfo.InvariantCulture))); + if (r_hash != null) urlBuilder_.Append("r_hash=").Append(System.Uri.EscapeDataString(System.Convert.ToString(r_hash, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcInvoice); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcInvoice); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `listinvoices` + /// ListInvoices returns a list of all the invoices currently stored within the + /// database. Any active debug invoices are ignored. + /// / Toggles if all invoices should be returned, or only those that are currently unsettled. + /// A server side error occurred. + public System.Threading.Tasks.Task ListInvoicesAsync(bool? pending_only) + { + return ListInvoicesAsync(pending_only, System.Threading.CancellationToken.None); + } + + /// * lncli: `listinvoices` + /// ListInvoices returns a list of all the invoices currently stored within the + /// database. Any active debug invoices are ignored. + /// / Toggles if all invoices should be returned, or only those that are currently unsettled. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ListInvoicesAsync(bool? pending_only, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/invoices?"); + if (pending_only != null) urlBuilder_.Append("pending_only=").Append(System.Uri.EscapeDataString(System.Convert.ToString(pending_only.Value, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcListInvoiceResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcListInvoiceResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `addinvoice` + /// AddInvoice attempts to add a new invoice to the invoice database. Any + /// duplicated invoices are rejected, therefore all invoices *must* have a + /// unique payment preimage. + /// A server side error occurred. + public System.Threading.Tasks.Task AddInvoiceAsync(LnrpcInvoice body) + { + return AddInvoiceAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `addinvoice` + /// AddInvoice attempts to add a new invoice to the invoice database. Any + /// duplicated invoices are rejected, therefore all invoices *must* have a + /// unique payment preimage. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task AddInvoiceAsync(LnrpcInvoice body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/invoices"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcAddInvoiceResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcAddInvoiceResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// SubscribeInvoices returns a uni-directional stream (sever -> client) for + /// notifying the client of newly added/settled invoices. + /// (streaming responses) + /// A server side error occurred. + public System.Threading.Tasks.Task SubscribeInvoicesAsync() + { + return SubscribeInvoicesAsync(System.Threading.CancellationToken.None); + } + + /// * + /// SubscribeInvoices returns a uni-directional stream (sever -> client) for + /// notifying the client of newly added/settled invoices. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// (streaming responses) + /// A server side error occurred. + public async System.Threading.Tasks.Task SubscribeInvoicesAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/invoices/subscribe"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcInvoice); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcInvoice); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// NewWitnessAddress creates a new witness address under control of the local wallet. + /// A server side error occurred. + public System.Threading.Tasks.Task NewWitnessAddressAsync() + { + return NewWitnessAddressAsync(System.Threading.CancellationToken.None); + } + + /// * + /// NewWitnessAddress creates a new witness address under control of the local wallet. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task NewWitnessAddressAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/newaddress"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcNewAddressResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcNewAddressResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `listpayments` + /// ListPayments returns a list of all outgoing payments. + /// A server side error occurred. + public System.Threading.Tasks.Task ListPaymentsAsync() + { + return ListPaymentsAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `listpayments` + /// ListPayments returns a list of all outgoing payments. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ListPaymentsAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/payments"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcListPaymentsResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcListPaymentsResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * + /// DeleteAllPayments deletes all outgoing payments from DB. + /// A server side error occurred. + public System.Threading.Tasks.Task DeleteAllPaymentsAsync() + { + return DeleteAllPaymentsAsync(System.Threading.CancellationToken.None); + } + + /// * + /// DeleteAllPayments deletes all outgoing payments from DB. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task DeleteAllPaymentsAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/payments"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `decodepayreq` + /// DecodePayReq takes an encoded payment request string and attempts to decode + /// it, returning a full description of the conditions encoded within the + /// payment request. + /// A server side error occurred. + public System.Threading.Tasks.Task DecodePayReqAsync(string pay_req) + { + return DecodePayReqAsync(pay_req, System.Threading.CancellationToken.None); + } + + /// * lncli: `decodepayreq` + /// DecodePayReq takes an encoded payment request string and attempts to decode + /// it, returning a full description of the conditions encoded within the + /// payment request. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task DecodePayReqAsync(string pay_req, System.Threading.CancellationToken cancellationToken) + { + if (pay_req == null) + throw new System.ArgumentNullException("pay_req"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/payreq/{pay_req}"); + urlBuilder_.Replace("{pay_req}", System.Uri.EscapeDataString(System.Convert.ToString(pay_req, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcPayReq); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcPayReq); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `listpeers` + /// ListPeers returns a verbose listing of all currently active peers. + /// A server side error occurred. + public System.Threading.Tasks.Task ListPeersAsync() + { + return ListPeersAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `listpeers` + /// ListPeers returns a verbose listing of all currently active peers. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ListPeersAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/peers"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcListPeersResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcListPeersResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `connect` + /// ConnectPeer attempts to establish a connection to a remote peer. This is at + /// the networking level, and is used for communication between nodes. This is + /// distinct from establishing a channel with a peer. + /// A server side error occurred. + public System.Threading.Tasks.Task ConnectPeerAsync(LnrpcConnectPeerRequest body) + { + return ConnectPeerAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `connect` + /// ConnectPeer attempts to establish a connection to a remote peer. This is at + /// the networking level, and is used for communication between nodes. This is + /// distinct from establishing a channel with a peer. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ConnectPeerAsync(LnrpcConnectPeerRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/peers"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `disconnect` + /// DisconnectPeer attempts to disconnect one peer from another identified by a + /// given pubKey. In the case that we currently have a pending or active channel + /// with the target peer, then this action will be not be allowed. + /// A server side error occurred. + public System.Threading.Tasks.Task DisconnectPeerAsync(string pub_key) + { + return DisconnectPeerAsync(pub_key, System.Threading.CancellationToken.None); + } + + /// * lncli: `disconnect` + /// DisconnectPeer attempts to disconnect one peer from another identified by a + /// given pubKey. In the case that we currently have a pending or active channel + /// with the target peer, then this action will be not be allowed. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task DisconnectPeerAsync(string pub_key, System.Threading.CancellationToken cancellationToken) + { + if (pub_key == null) + throw new System.ArgumentNullException("pub_key"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/peers/{pub_key}"); + urlBuilder_.Replace("{pub_key}", System.Uri.EscapeDataString(System.Convert.ToString(pub_key, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `fwdinghistory` + /// ForwardingHistory allows the caller to query the htlcswitch for a record of + /// all HTLC's forwarded within the target time range, and integer offset + /// within that time range. If no time-range is specified, then the first chunk + /// of the past 24 hrs of forwarding history are returned. + /// A server side error occurred. + public System.Threading.Tasks.Task ForwardingHistoryAsync(LnrpcForwardingHistoryRequest body) + { + return ForwardingHistoryAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `fwdinghistory` + /// ForwardingHistory allows the caller to query the htlcswitch for a record of + /// all HTLC's forwarded within the target time range, and integer offset + /// within that time range. If no time-range is specified, then the first chunk + /// of the past 24 hrs of forwarding history are returned. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task ForwardingHistoryAsync(LnrpcForwardingHistoryRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/switch"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcForwardingHistoryResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcForwardingHistoryResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `listchaintxns` + /// GetTransactions returns a list describing all the known transactions + /// relevant to the wallet. + /// A server side error occurred. + public System.Threading.Tasks.Task GetTransactionsAsync() + { + return GetTransactionsAsync(System.Threading.CancellationToken.None); + } + + /// * lncli: `listchaintxns` + /// GetTransactions returns a list describing all the known transactions + /// relevant to the wallet. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task GetTransactionsAsync(System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/transactions"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcTransactionDetails); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcTransactionDetails); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `sendcoins` + /// SendCoins executes a request to send coins to a particular address. Unlike + /// SendMany, this RPC call only allows creating a single output at a time. If + /// neither target_conf, or sat_per_byte are set, then the internal wallet will + /// consult its fee model to determine a fee for the default confirmation + /// target. + /// A server side error occurred. + public System.Threading.Tasks.Task SendCoinsAsync(LnrpcSendCoinsRequest body) + { + return SendCoinsAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `sendcoins` + /// SendCoins executes a request to send coins to a particular address. Unlike + /// SendMany, this RPC call only allows creating a single output at a time. If + /// neither target_conf, or sat_per_byte are set, then the internal wallet will + /// consult its fee model to determine a fee for the default confirmation + /// target. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task SendCoinsAsync(LnrpcSendCoinsRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/transactions"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(LnrpcSendCoinsResponse); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(LnrpcSendCoinsResponse); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + /// * lncli: `unlock` + /// UnlockWallet is used at startup of lnd to provide a password to unlock + /// the wallet database. + /// A server side error occurred. + public System.Threading.Tasks.Task UnlockWalletAsync(LnrpcUnlockWalletRequest body) + { + return UnlockWalletAsync(body, System.Threading.CancellationToken.None); + } + + /// * lncli: `unlock` + /// UnlockWallet is used at startup of lnd to provide a password to unlock + /// the wallet database. + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// A server side error occurred. + public async System.Threading.Tasks.Task UnlockWalletAsync(LnrpcUnlockWalletRequest body, System.Threading.CancellationToken cancellationToken) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl).Append("/v1/unlockwallet"); + + var client_ = _httpClient; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); + content_.Headers.ContentType.MediaType = "application/json"; + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + + ProcessResponse(client_, response_); + + var status_ = ((int)response_.StatusCode).ToString(); + if (status_ == "200") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + var result_ = default(object); + try + { + result_ = Newtonsoft.Json.JsonConvert.DeserializeObject(responseData_, _settings.Value); + return result_; + } + catch (System.Exception exception) + { + throw new SwaggerException("Could not deserialize the response body.", status_, responseData_, headers_, exception); + } + } + else + if (status_ != "200" && status_ != "204") + { + var responseData_ = await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new SwaggerException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, headers_, null); + } + + return default(object); + } + finally + { + if (response_ != null) + response_.Dispose(); + } + } + } + finally + { + } + } + + } + + + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class PendingChannelsResponseClosedChannel : System.ComponentModel.INotifyPropertyChanged + { + private PendingChannelsResponsePendingChannel _channel; + private string _closing_txid; + + [Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PendingChannelsResponsePendingChannel Channel + { + get { return _channel; } + set + { + if (_channel != value) + { + _channel = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("closing_txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Closing_txid + { + get { return _closing_txid; } + set + { + if (_closing_txid != value) + { + _closing_txid = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static PendingChannelsResponseClosedChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class PendingChannelsResponseForceClosedChannel : System.ComponentModel.INotifyPropertyChanged + { + private PendingChannelsResponsePendingChannel _channel; + private string _closing_txid; + private string _limbo_balance; + private long? _maturity_height; + private int? _blocks_til_maturity; + private string _recovered_balance; + private System.Collections.ObjectModel.ObservableCollection _pending_htlcs; + + [Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PendingChannelsResponsePendingChannel Channel + { + get { return _channel; } + set + { + if (_channel != value) + { + _channel = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("closing_txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Closing_txid + { + get { return _closing_txid; } + set + { + if (_closing_txid != value) + { + _closing_txid = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("limbo_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Limbo_balance + { + get { return _limbo_balance; } + set + { + if (_limbo_balance != value) + { + _limbo_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("maturity_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Maturity_height + { + get { return _maturity_height; } + set + { + if (_maturity_height != value) + { + _maturity_height = value; + RaisePropertyChanged(); + } + } + } + + /// Remaining # of blocks until the commitment output can be swept. + /// Negative values indicate how many blocks have passed since becoming + /// mature. + [Newtonsoft.Json.JsonProperty("blocks_til_maturity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Blocks_til_maturity + { + get { return _blocks_til_maturity; } + set + { + if (_blocks_til_maturity != value) + { + _blocks_til_maturity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("recovered_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Recovered_balance + { + get { return _recovered_balance; } + set + { + if (_recovered_balance != value) + { + _recovered_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pending_htlcs", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Pending_htlcs + { + get { return _pending_htlcs; } + set + { + if (_pending_htlcs != value) + { + _pending_htlcs = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static PendingChannelsResponseForceClosedChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class PendingChannelsResponsePendingChannel : System.ComponentModel.INotifyPropertyChanged + { + private string _remote_node_pub; + private string _channel_point; + private string _capacity; + private string _local_balance; + private string _remote_balance; + + [Newtonsoft.Json.JsonProperty("remote_node_pub", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Remote_node_pub + { + get { return _remote_node_pub; } + set + { + if (_remote_node_pub != value) + { + _remote_node_pub = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("channel_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Channel_point + { + get { return _channel_point; } + set + { + if (_channel_point != value) + { + _channel_point = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Capacity + { + get { return _capacity; } + set + { + if (_capacity != value) + { + _capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("local_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Local_balance + { + get { return _local_balance; } + set + { + if (_local_balance != value) + { + _local_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("remote_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Remote_balance + { + get { return _remote_balance; } + set + { + if (_remote_balance != value) + { + _remote_balance = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static PendingChannelsResponsePendingChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class PendingChannelsResponsePendingOpenChannel : System.ComponentModel.INotifyPropertyChanged + { + private PendingChannelsResponsePendingChannel _channel; + private long? _confirmation_height; + private string _commit_fee; + private string _commit_weight; + private string _fee_per_kw; + + [Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PendingChannelsResponsePendingChannel Channel + { + get { return _channel; } + set + { + if (_channel != value) + { + _channel = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("confirmation_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Confirmation_height + { + get { return _confirmation_height; } + set + { + if (_confirmation_height != value) + { + _confirmation_height = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The amount calculated to be paid in fees for the current set of + /// commitment transactions. The fee amount is persisted with the channel + /// in order to allow the fee amount to be removed and recalculated with + /// each channel state update, including updates that happen after a system + /// restart. + [Newtonsoft.Json.JsonProperty("commit_fee", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Commit_fee + { + get { return _commit_fee; } + set + { + if (_commit_fee != value) + { + _commit_fee = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("commit_weight", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Commit_weight + { + get { return _commit_weight; } + set + { + if (_commit_weight != value) + { + _commit_weight = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The required number of satoshis per kilo-weight that the requester will + /// pay at all times, for both the funding transaction and commitment + /// transaction. This value can later be updated once the channel is open. + [Newtonsoft.Json.JsonProperty("fee_per_kw", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_per_kw + { + get { return _fee_per_kw; } + set + { + if (_fee_per_kw != value) + { + _fee_per_kw = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static PendingChannelsResponsePendingOpenChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class PendingChannelsResponseWaitingCloseChannel : System.ComponentModel.INotifyPropertyChanged + { + private PendingChannelsResponsePendingChannel _channel; + private string _limbo_balance; + + [Newtonsoft.Json.JsonProperty("channel", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public PendingChannelsResponsePendingChannel Channel + { + get { return _channel; } + set + { + if (_channel != value) + { + _channel = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("limbo_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Limbo_balance + { + get { return _limbo_balance; } + set + { + if (_limbo_balance != value) + { + _limbo_balance = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static PendingChannelsResponseWaitingCloseChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcAddInvoiceResponse : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _r_hash; + private string _payment_request; + + [Newtonsoft.Json.JsonProperty("r_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] R_hash + { + get { return _r_hash; } + set + { + if (_r_hash != value) + { + _r_hash = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// A bare-bones invoice for a payment within the Lightning Network. With the + /// details of the invoice, the sender has all the data necessary to send a + /// payment to the recipient. + [Newtonsoft.Json.JsonProperty("payment_request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_request + { + get { return _payment_request; } + set + { + if (_payment_request != value) + { + _payment_request = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcAddInvoiceResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannel : System.ComponentModel.INotifyPropertyChanged + { + private bool? _active; + private string _remote_pubkey; + private string _channel_point; + private string _chan_id; + private string _capacity; + private string _local_balance; + private string _remote_balance; + private string _commit_fee; + private string _commit_weight; + private string _fee_per_kw; + private string _unsettled_balance; + private string _total_satoshis_sent; + private string _total_satoshis_received; + private string _num_updates; + private System.Collections.ObjectModel.ObservableCollection _pending_htlcs; + private long? _csv_delay; + private bool? _private; + + [Newtonsoft.Json.JsonProperty("active", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Active + { + get { return _active; } + set + { + if (_active != value) + { + _active = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("remote_pubkey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Remote_pubkey + { + get { return _remote_pubkey; } + set + { + if (_remote_pubkey != value) + { + _remote_pubkey = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The outpoint (txid:index) of the funding transaction. With this value, Bob + /// will be able to generate a signature for Alice's version of the commitment + /// transaction. + [Newtonsoft.Json.JsonProperty("channel_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Channel_point + { + get { return _channel_point; } + set + { + if (_channel_point != value) + { + _channel_point = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The unique channel ID for the channel. The first 3 bytes are the block + /// height, the next 3 the index within the block, and the last 2 bytes are the + /// output index for the channel. + [Newtonsoft.Json.JsonProperty("chan_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id + { + get { return _chan_id; } + set + { + if (_chan_id != value) + { + _chan_id = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Capacity + { + get { return _capacity; } + set + { + if (_capacity != value) + { + _capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("local_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Local_balance + { + get { return _local_balance; } + set + { + if (_local_balance != value) + { + _local_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("remote_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Remote_balance + { + get { return _remote_balance; } + set + { + if (_remote_balance != value) + { + _remote_balance = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The amount calculated to be paid in fees for the current set of commitment + /// transactions. The fee amount is persisted with the channel in order to + /// allow the fee amount to be removed and recalculated with each channel state + /// update, including updates that happen after a system restart. + [Newtonsoft.Json.JsonProperty("commit_fee", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Commit_fee + { + get { return _commit_fee; } + set + { + if (_commit_fee != value) + { + _commit_fee = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("commit_weight", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Commit_weight + { + get { return _commit_weight; } + set + { + if (_commit_weight != value) + { + _commit_weight = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The required number of satoshis per kilo-weight that the requester will pay + /// at all times, for both the funding transaction and commitment transaction. + /// This value can later be updated once the channel is open. + [Newtonsoft.Json.JsonProperty("fee_per_kw", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_per_kw + { + get { return _fee_per_kw; } + set + { + if (_fee_per_kw != value) + { + _fee_per_kw = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("unsettled_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Unsettled_balance + { + get { return _unsettled_balance; } + set + { + if (_unsettled_balance != value) + { + _unsettled_balance = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total number of satoshis we've sent within this channel. + [Newtonsoft.Json.JsonProperty("total_satoshis_sent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_satoshis_sent + { + get { return _total_satoshis_sent; } + set + { + if (_total_satoshis_sent != value) + { + _total_satoshis_sent = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total number of satoshis we've received within this channel. + [Newtonsoft.Json.JsonProperty("total_satoshis_received", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_satoshis_received + { + get { return _total_satoshis_received; } + set + { + if (_total_satoshis_received != value) + { + _total_satoshis_received = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total number of updates conducted within this channel. + [Newtonsoft.Json.JsonProperty("num_updates", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Num_updates + { + get { return _num_updates; } + set + { + if (_num_updates != value) + { + _num_updates = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The list of active, uncleared HTLCs currently pending within the channel. + [Newtonsoft.Json.JsonProperty("pending_htlcs", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Pending_htlcs + { + get { return _pending_htlcs; } + set + { + if (_pending_htlcs != value) + { + _pending_htlcs = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The CSV delay expressed in relative blocks. If the channel is force + /// closed, we'll need to wait for this many blocks before we can regain our + /// funds. + [Newtonsoft.Json.JsonProperty("csv_delay", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Csv_delay + { + get { return _csv_delay; } + set + { + if (_csv_delay != value) + { + _csv_delay = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("private", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Private + { + get { return _private; } + set + { + if (_private != value) + { + _private = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannel FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelBalanceResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _balance; + private string _pending_open_balance; + + [Newtonsoft.Json.JsonProperty("balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Balance + { + get { return _balance; } + set + { + if (_balance != value) + { + _balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pending_open_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Pending_open_balance + { + get { return _pending_open_balance; } + set + { + if (_pending_open_balance != value) + { + _pending_open_balance = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelBalanceResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelCloseUpdate : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _closing_txid; + private bool? _success; + + [Newtonsoft.Json.JsonProperty("closing_txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Closing_txid + { + get { return _closing_txid; } + set + { + if (_closing_txid != value) + { + _closing_txid = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("success", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Success + { + get { return _success; } + set + { + if (_success != value) + { + _success = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelCloseUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + /// * + /// A fully authenticated channel along with all its unique attributes. + /// Once an authenticated channel announcement has been processed on the network, + /// then an instance of ChannelEdgeInfo encapsulating the channels attributes is + /// stored. The other portions relevant to routing policy of a channel are stored + /// within a ChannelEdgePolicy for each direction of the channel. + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelEdge : System.ComponentModel.INotifyPropertyChanged + { + private string _channel_id; + private string _chan_point; + private long? _last_update; + private string _node1_pub; + private string _node2_pub; + private string _capacity; + private LnrpcRoutingPolicy _node1_policy; + private LnrpcRoutingPolicy _node2_policy; + + /// * + /// The unique channel ID for the channel. The first 3 bytes are the block + /// height, the next 3 the index within the block, and the last 2 bytes are the + /// output index for the channel. + [Newtonsoft.Json.JsonProperty("channel_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Channel_id + { + get { return _channel_id; } + set + { + if (_channel_id != value) + { + _channel_id = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_point + { + get { return _chan_point; } + set + { + if (_chan_point != value) + { + _chan_point = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("last_update", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Last_update + { + get { return _last_update; } + set + { + if (_last_update != value) + { + _last_update = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("node1_pub", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Node1_pub + { + get { return _node1_pub; } + set + { + if (_node1_pub != value) + { + _node1_pub = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("node2_pub", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Node2_pub + { + get { return _node2_pub; } + set + { + if (_node2_pub != value) + { + _node2_pub = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Capacity + { + get { return _capacity; } + set + { + if (_capacity != value) + { + _capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("node1_policy", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcRoutingPolicy Node1_policy + { + get { return _node1_policy; } + set + { + if (_node1_policy != value) + { + _node1_policy = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("node2_policy", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcRoutingPolicy Node2_policy + { + get { return _node2_policy; } + set + { + if (_node2_policy != value) + { + _node2_policy = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelEdge FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelEdgeUpdate : System.ComponentModel.INotifyPropertyChanged + { + private string _chan_id; + private LnrpcChannelPoint _chan_point; + private string _capacity; + private LnrpcRoutingPolicy _routing_policy; + private string _advertising_node; + private string _connecting_node; + + /// * + /// The unique channel ID for the channel. The first 3 bytes are the block + /// height, the next 3 the index within the block, and the last 2 bytes are the + /// output index for the channel. + [Newtonsoft.Json.JsonProperty("chan_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id + { + get { return _chan_id; } + set + { + if (_chan_id != value) + { + _chan_id = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelPoint Chan_point + { + get { return _chan_point; } + set + { + if (_chan_point != value) + { + _chan_point = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Capacity + { + get { return _capacity; } + set + { + if (_capacity != value) + { + _capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("routing_policy", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcRoutingPolicy Routing_policy + { + get { return _routing_policy; } + set + { + if (_routing_policy != value) + { + _routing_policy = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("advertising_node", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Advertising_node + { + get { return _advertising_node; } + set + { + if (_advertising_node != value) + { + _advertising_node = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("connecting_node", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Connecting_node + { + get { return _connecting_node; } + set + { + if (_connecting_node != value) + { + _connecting_node = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelEdgeUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelFeeReport : System.ComponentModel.INotifyPropertyChanged + { + private string _chan_point; + private string _base_fee_msat; + private string _fee_per_mil; + private double? _fee_rate; + + /// / The channel that this fee report belongs to. + [Newtonsoft.Json.JsonProperty("chan_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_point + { + get { return _chan_point; } + set + { + if (_chan_point != value) + { + _chan_point = value; + RaisePropertyChanged(); + } + } + } + + /// / The base fee charged regardless of the number of milli-satoshis sent. + [Newtonsoft.Json.JsonProperty("base_fee_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Base_fee_msat + { + get { return _base_fee_msat; } + set + { + if (_base_fee_msat != value) + { + _base_fee_msat = value; + RaisePropertyChanged(); + } + } + } + + /// / The amount charged per milli-satoshis transferred expressed in millionths of a satoshi. + [Newtonsoft.Json.JsonProperty("fee_per_mil", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_per_mil + { + get { return _fee_per_mil; } + set + { + if (_fee_per_mil != value) + { + _fee_per_mil = value; + RaisePropertyChanged(); + } + } + } + + /// / The effective fee rate in milli-satoshis. Computed by dividing the fee_per_mil value by 1 million. + [Newtonsoft.Json.JsonProperty("fee_rate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double? Fee_rate + { + get { return _fee_rate; } + set + { + if (_fee_rate != value) + { + _fee_rate = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelFeeReport FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + /// / Returns a new instance of the directed channel graph. + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelGraph : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _nodes; + private System.Collections.ObjectModel.ObservableCollection _edges; + + [Newtonsoft.Json.JsonProperty("nodes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Nodes + { + get { return _nodes; } + set + { + if (_nodes != value) + { + _nodes = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("edges", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Edges + { + get { return _edges; } + set + { + if (_edges != value) + { + _edges = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelGraph FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelOpenUpdate : System.ComponentModel.INotifyPropertyChanged + { + private LnrpcChannelPoint _channel_point; + + [Newtonsoft.Json.JsonProperty("channel_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelPoint Channel_point + { + get { return _channel_point; } + set + { + if (_channel_point != value) + { + _channel_point = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelOpenUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcChannelPoint : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _funding_txid_bytes; + private string _funding_txid_str; + private long? _output_index; + + [Newtonsoft.Json.JsonProperty("funding_txid_bytes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Funding_txid_bytes + { + get { return _funding_txid_bytes; } + set + { + if (_funding_txid_bytes != value) + { + _funding_txid_bytes = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("funding_txid_str", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Funding_txid_str + { + get { return _funding_txid_str; } + set + { + if (_funding_txid_str != value) + { + _funding_txid_str = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("output_index", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Output_index + { + get { return _output_index; } + set + { + if (_output_index != value) + { + _output_index = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcChannelPoint FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcCloseStatusUpdate : System.ComponentModel.INotifyPropertyChanged + { + private LnrpcPendingUpdate _close_pending; + private LnrpcConfirmationUpdate _confirmation; + private LnrpcChannelCloseUpdate _chan_close; + + [Newtonsoft.Json.JsonProperty("close_pending", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcPendingUpdate Close_pending + { + get { return _close_pending; } + set + { + if (_close_pending != value) + { + _close_pending = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("confirmation", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcConfirmationUpdate Confirmation + { + get { return _confirmation; } + set + { + if (_confirmation != value) + { + _confirmation = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_close", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelCloseUpdate Chan_close + { + get { return _chan_close; } + set + { + if (_chan_close != value) + { + _chan_close = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcCloseStatusUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcClosedChannelUpdate : System.ComponentModel.INotifyPropertyChanged + { + private string _chan_id; + private string _capacity; + private long? _closed_height; + private LnrpcChannelPoint _chan_point; + + /// * + /// The unique channel ID for the channel. The first 3 bytes are the block + /// height, the next 3 the index within the block, and the last 2 bytes are the + /// output index for the channel. + [Newtonsoft.Json.JsonProperty("chan_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id + { + get { return _chan_id; } + set + { + if (_chan_id != value) + { + _chan_id = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Capacity + { + get { return _capacity; } + set + { + if (_capacity != value) + { + _capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("closed_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Closed_height + { + get { return _closed_height; } + set + { + if (_closed_height != value) + { + _closed_height = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelPoint Chan_point + { + get { return _chan_point; } + set + { + if (_chan_point != value) + { + _chan_point = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcClosedChannelUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcConfirmationUpdate : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _block_sha; + private int? _block_height; + private long? _num_confs_left; + + [Newtonsoft.Json.JsonProperty("block_sha", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Block_sha + { + get { return _block_sha; } + set + { + if (_block_sha != value) + { + _block_sha = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("block_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Block_height + { + get { return _block_height; } + set + { + if (_block_height != value) + { + _block_height = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_confs_left", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_confs_left + { + get { return _num_confs_left; } + set + { + if (_num_confs_left != value) + { + _num_confs_left = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcConfirmationUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcConnectPeerRequest : System.ComponentModel.INotifyPropertyChanged + { + private LnrpcLightningAddress _addr; + private bool? _perm; + + [Newtonsoft.Json.JsonProperty("addr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcLightningAddress Addr + { + get { return _addr; } + set + { + if (_addr != value) + { + _addr = value; + RaisePropertyChanged(); + } + } + } + + /// * If set, the daemon will attempt to persistently connect to the target + /// peer. Otherwise, the call will be synchronous. + [Newtonsoft.Json.JsonProperty("perm", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Perm + { + get { return _perm; } + set + { + if (_perm != value) + { + _perm = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcConnectPeerRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcDebugLevelResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _sub_systems; + + [Newtonsoft.Json.JsonProperty("sub_systems", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Sub_systems + { + get { return _sub_systems; } + set + { + if (_sub_systems != value) + { + _sub_systems = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcDebugLevelResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcFeeReportResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _channel_fees; + private string _day_fee_sum; + private string _week_fee_sum; + private string _month_fee_sum; + + /// / An array of channel fee reports which describes the current fee schedule for each channel. + [Newtonsoft.Json.JsonProperty("channel_fees", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Channel_fees + { + get { return _channel_fees; } + set + { + if (_channel_fees != value) + { + _channel_fees = value; + RaisePropertyChanged(); + } + } + } + + /// / The total amount of fee revenue (in satoshis) the switch has collected over the past 24 hrs. + [Newtonsoft.Json.JsonProperty("day_fee_sum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Day_fee_sum + { + get { return _day_fee_sum; } + set + { + if (_day_fee_sum != value) + { + _day_fee_sum = value; + RaisePropertyChanged(); + } + } + } + + /// / The total amount of fee revenue (in satoshis) the switch has collected over the past 1 week. + [Newtonsoft.Json.JsonProperty("week_fee_sum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Week_fee_sum + { + get { return _week_fee_sum; } + set + { + if (_week_fee_sum != value) + { + _week_fee_sum = value; + RaisePropertyChanged(); + } + } + } + + /// / The total amount of fee revenue (in satoshis) the switch has collected over the past 1 month. + [Newtonsoft.Json.JsonProperty("month_fee_sum", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Month_fee_sum + { + get { return _month_fee_sum; } + set + { + if (_month_fee_sum != value) + { + _month_fee_sum = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcFeeReportResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcForwardingEvent : System.ComponentModel.INotifyPropertyChanged + { + private string _timestamp; + private string _chan_id_in; + private string _chan_id_out; + private string _amt_in; + private string _amt_out; + private string _fee; + + /// / Timestamp is the time (unix epoch offset) that this circuit was completed. + [Newtonsoft.Json.JsonProperty("timestamp", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Timestamp + { + get { return _timestamp; } + set + { + if (_timestamp != value) + { + _timestamp = value; + RaisePropertyChanged(); + } + } + } + + /// / The incoming channel ID that carried the HTLC that created the circuit. + [Newtonsoft.Json.JsonProperty("chan_id_in", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id_in + { + get { return _chan_id_in; } + set + { + if (_chan_id_in != value) + { + _chan_id_in = value; + RaisePropertyChanged(); + } + } + } + + /// / The outgoing channel ID that carried the preimage that completed the circuit. + [Newtonsoft.Json.JsonProperty("chan_id_out", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id_out + { + get { return _chan_id_out; } + set + { + if (_chan_id_out != value) + { + _chan_id_out = value; + RaisePropertyChanged(); + } + } + } + + /// / The total amount of the incoming HTLC that created half the circuit. + [Newtonsoft.Json.JsonProperty("amt_in", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amt_in + { + get { return _amt_in; } + set + { + if (_amt_in != value) + { + _amt_in = value; + RaisePropertyChanged(); + } + } + } + + /// / The total amount of the outgoign HTLC that created the second half of the circuit. + [Newtonsoft.Json.JsonProperty("amt_out", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amt_out + { + get { return _amt_out; } + set + { + if (_amt_out != value) + { + _amt_out = value; + RaisePropertyChanged(); + } + } + } + + /// / The total fee that this payment circuit carried. + [Newtonsoft.Json.JsonProperty("fee", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee + { + get { return _fee; } + set + { + if (_fee != value) + { + _fee = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcForwardingEvent FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcForwardingHistoryRequest : System.ComponentModel.INotifyPropertyChanged + { + private string _start_time; + private string _end_time; + private long? _index_offset; + private long? _num_max_events; + + /// / Start time is the starting point of the forwarding history request. All records beyond this point will be included, respecting the end time, and the index offset. + [Newtonsoft.Json.JsonProperty("start_time", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Start_time + { + get { return _start_time; } + set + { + if (_start_time != value) + { + _start_time = value; + RaisePropertyChanged(); + } + } + } + + /// / End time is the end point of the forwarding history request. The response will carry at most 50k records between the start time and the end time. The index offset can be used to implement pagination. + [Newtonsoft.Json.JsonProperty("end_time", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string End_time + { + get { return _end_time; } + set + { + if (_end_time != value) + { + _end_time = value; + RaisePropertyChanged(); + } + } + } + + /// / Index offset is the offset in the time series to start at. As each response can only contain 50k records, callers can use this to skip around within a packed time series. + [Newtonsoft.Json.JsonProperty("index_offset", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Index_offset + { + get { return _index_offset; } + set + { + if (_index_offset != value) + { + _index_offset = value; + RaisePropertyChanged(); + } + } + } + + /// / The max number of events to return in the response to this query. + [Newtonsoft.Json.JsonProperty("num_max_events", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_max_events + { + get { return _num_max_events; } + set + { + if (_num_max_events != value) + { + _num_max_events = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcForwardingHistoryRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcForwardingHistoryResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _forwarding_events; + private long? _last_offset_index; + + /// / A list of forwarding events from the time slice of the time series specified in the request. + [Newtonsoft.Json.JsonProperty("forwarding_events", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Forwarding_events + { + get { return _forwarding_events; } + set + { + if (_forwarding_events != value) + { + _forwarding_events = value; + RaisePropertyChanged(); + } + } + } + + /// / The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style. + [Newtonsoft.Json.JsonProperty("last_offset_index", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Last_offset_index + { + get { return _last_offset_index; } + set + { + if (_last_offset_index != value) + { + _last_offset_index = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcForwardingHistoryResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcGenSeedResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _cipher_seed_mnemonic; + private byte[] _enciphered_seed; + + /// * + /// cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed + /// cipher seed obtained by the user. This field is optional, as if not + /// provided, then the daemon will generate a new cipher seed for the user. + /// Otherwise, then the daemon will attempt to recover the wallet state linked + /// to this cipher seed. + [Newtonsoft.Json.JsonProperty("cipher_seed_mnemonic", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Cipher_seed_mnemonic + { + get { return _cipher_seed_mnemonic; } + set + { + if (_cipher_seed_mnemonic != value) + { + _cipher_seed_mnemonic = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// enciphered_seed are the raw aezeed cipher seed bytes. This is the raw + /// cipher text before run through our mnemonic encoding scheme. + [Newtonsoft.Json.JsonProperty("enciphered_seed", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Enciphered_seed + { + get { return _enciphered_seed; } + set + { + if (_enciphered_seed != value) + { + _enciphered_seed = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcGenSeedResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcGetInfoResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _identity_pubkey; + private string _alias; + private long? _num_pending_channels; + private long? _num_active_channels; + private long? _num_peers; + private long? _block_height; + private string _block_hash; + private bool? _synced_to_chain; + private bool? _testnet; + private System.Collections.ObjectModel.ObservableCollection _chains; + private System.Collections.ObjectModel.ObservableCollection _uris; + private string _best_header_timestamp; + private string _version; + + /// / The identity pubkey of the current node. + [Newtonsoft.Json.JsonProperty("identity_pubkey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Identity_pubkey + { + get { return _identity_pubkey; } + set + { + if (_identity_pubkey != value) + { + _identity_pubkey = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("alias", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Alias + { + get { return _alias; } + set + { + if (_alias != value) + { + _alias = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_pending_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_pending_channels + { + get { return _num_pending_channels; } + set + { + if (_num_pending_channels != value) + { + _num_pending_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_active_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_active_channels + { + get { return _num_active_channels; } + set + { + if (_num_active_channels != value) + { + _num_active_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_peers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_peers + { + get { return _num_peers; } + set + { + if (_num_peers != value) + { + _num_peers = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("block_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Block_height + { + get { return _block_height; } + set + { + if (_block_height != value) + { + _block_height = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("block_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Block_hash + { + get { return _block_hash; } + set + { + if (_block_hash != value) + { + _block_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("synced_to_chain", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Synced_to_chain + { + get { return _synced_to_chain; } + set + { + if (_synced_to_chain != value) + { + _synced_to_chain = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("testnet", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Testnet + { + get { return _testnet; } + set + { + if (_testnet != value) + { + _testnet = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chains", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Chains + { + get { return _chains; } + set + { + if (_chains != value) + { + _chains = value; + RaisePropertyChanged(); + } + } + } + + /// / The URIs of the current node. + [Newtonsoft.Json.JsonProperty("uris", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Uris + { + get { return _uris; } + set + { + if (_uris != value) + { + _uris = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("best_header_timestamp", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Best_header_timestamp + { + get { return _best_header_timestamp; } + set + { + if (_best_header_timestamp != value) + { + _best_header_timestamp = value; + RaisePropertyChanged(); + } + } + } + + /// / The version of the LND software that the node is running. + [Newtonsoft.Json.JsonProperty("version", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Version + { + get { return _version; } + set + { + if (_version != value) + { + _version = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcGetInfoResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcGraphTopologyUpdate : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _node_updates; + private System.Collections.ObjectModel.ObservableCollection _channel_updates; + private System.Collections.ObjectModel.ObservableCollection _closed_chans; + + [Newtonsoft.Json.JsonProperty("node_updates", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Node_updates + { + get { return _node_updates; } + set + { + if (_node_updates != value) + { + _node_updates = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("channel_updates", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Channel_updates + { + get { return _channel_updates; } + set + { + if (_channel_updates != value) + { + _channel_updates = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("closed_chans", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Closed_chans + { + get { return _closed_chans; } + set + { + if (_closed_chans != value) + { + _closed_chans = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcGraphTopologyUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcHTLC : System.ComponentModel.INotifyPropertyChanged + { + private bool? _incoming; + private string _amount; + private byte[] _hash_lock; + private long? _expiration_height; + + [Newtonsoft.Json.JsonProperty("incoming", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Incoming + { + get { return _incoming; } + set + { + if (_incoming != value) + { + _incoming = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amount + { + get { return _amount; } + set + { + if (_amount != value) + { + _amount = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("hash_lock", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Hash_lock + { + get { return _hash_lock; } + set + { + if (_hash_lock != value) + { + _hash_lock = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("expiration_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Expiration_height + { + get { return _expiration_height; } + set + { + if (_expiration_height != value) + { + _expiration_height = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcHTLC FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcHop : System.ComponentModel.INotifyPropertyChanged + { + private string _chan_id; + private string _chan_capacity; + private string _amt_to_forward; + private string _fee; + private long? _expiry; + private string _amt_to_forward_msat; + private string _fee_msat; + + /// * + /// The unique channel ID for the channel. The first 3 bytes are the block + /// height, the next 3 the index within the block, and the last 2 bytes are the + /// output index for the channel. + [Newtonsoft.Json.JsonProperty("chan_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id + { + get { return _chan_id; } + set + { + if (_chan_id != value) + { + _chan_id = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_capacity + { + get { return _chan_capacity; } + set + { + if (_chan_capacity != value) + { + _chan_capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amt_to_forward", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amt_to_forward + { + get { return _amt_to_forward; } + set + { + if (_amt_to_forward != value) + { + _amt_to_forward = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fee", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee + { + get { return _fee; } + set + { + if (_fee != value) + { + _fee = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("expiry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Expiry + { + get { return _expiry; } + set + { + if (_expiry != value) + { + _expiry = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amt_to_forward_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amt_to_forward_msat + { + get { return _amt_to_forward_msat; } + set + { + if (_amt_to_forward_msat != value) + { + _amt_to_forward_msat = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fee_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_msat + { + get { return _fee_msat; } + set + { + if (_fee_msat != value) + { + _fee_msat = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcHop FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcHopHint : System.ComponentModel.INotifyPropertyChanged + { + private string _node_id; + private string _chan_id; + private long? _fee_base_msat; + private long? _fee_proportional_millionths; + private long? _cltv_expiry_delta; + + /// / The public key of the node at the start of the channel. + [Newtonsoft.Json.JsonProperty("node_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Node_id + { + get { return _node_id; } + set + { + if (_node_id != value) + { + _node_id = value; + RaisePropertyChanged(); + } + } + } + + /// / The unique identifier of the channel. + [Newtonsoft.Json.JsonProperty("chan_id", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Chan_id + { + get { return _chan_id; } + set + { + if (_chan_id != value) + { + _chan_id = value; + RaisePropertyChanged(); + } + } + } + + /// / The base fee of the channel denominated in millisatoshis. + [Newtonsoft.Json.JsonProperty("fee_base_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Fee_base_msat + { + get { return _fee_base_msat; } + set + { + if (_fee_base_msat != value) + { + _fee_base_msat = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The fee rate of the channel for sending one satoshi across it denominated in + /// millionths of a satoshi. + [Newtonsoft.Json.JsonProperty("fee_proportional_millionths", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Fee_proportional_millionths + { + get { return _fee_proportional_millionths; } + set + { + if (_fee_proportional_millionths != value) + { + _fee_proportional_millionths = value; + RaisePropertyChanged(); + } + } + } + + /// / The time-lock delta of the channel. + [Newtonsoft.Json.JsonProperty("cltv_expiry_delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Cltv_expiry_delta + { + get { return _cltv_expiry_delta; } + set + { + if (_cltv_expiry_delta != value) + { + _cltv_expiry_delta = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcHopHint FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcInitWalletRequest : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _wallet_password; + private System.Collections.ObjectModel.ObservableCollection _cipher_seed_mnemonic; + private byte[] _aezeed_passphrase; + private int? _recovery_window; + + /// * + /// wallet_password is the passphrase that should be used to encrypt the + /// wallet. This MUST be at least 8 chars in length. After creation, this + /// password is required to unlock the daemon. + [Newtonsoft.Json.JsonProperty("wallet_password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Wallet_password + { + get { return _wallet_password; } + set + { + if (_wallet_password != value) + { + _wallet_password = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed + /// cipher seed obtained by the user. This may have been generated by the + /// GenSeed method, or be an existing seed. + [Newtonsoft.Json.JsonProperty("cipher_seed_mnemonic", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Cipher_seed_mnemonic + { + get { return _cipher_seed_mnemonic; } + set + { + if (_cipher_seed_mnemonic != value) + { + _cipher_seed_mnemonic = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// aezeed_passphrase is an optional user provided passphrase that will be used + /// to encrypt the generated aezeed cipher seed. + [Newtonsoft.Json.JsonProperty("aezeed_passphrase", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Aezeed_passphrase + { + get { return _aezeed_passphrase; } + set + { + if (_aezeed_passphrase != value) + { + _aezeed_passphrase = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// recovery_window is an optional argument specifying the address lookahead + /// when restoring a wallet seed. The recovery window applies to each + /// invdividual branch of the BIP44 derivation paths. Supplying a recovery + /// window of zero indicates that no addresses should be recovered, such after + /// the first initialization of the wallet. + [Newtonsoft.Json.JsonProperty("recovery_window", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Recovery_window + { + get { return _recovery_window; } + set + { + if (_recovery_window != value) + { + _recovery_window = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcInitWalletRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcInvoice : System.ComponentModel.INotifyPropertyChanged + { + private string _memo; + private byte[] _receipt; + private byte[] _r_preimage; + private byte[] _r_hash; + private string _value; + private bool? _settled; + private string _creation_date; + private string _settle_date; + private string _payment_request; + private byte[] _description_hash; + private string _expiry; + private string _fallback_addr; + private string _cltv_expiry; + private System.Collections.ObjectModel.ObservableCollection _route_hints; + private bool? _private; + + /// * + /// An optional memo to attach along with the invoice. Used for record keeping + /// purposes for the invoice's creator, and will also be set in the description + /// field of the encoded payment request if the description_hash field is not + /// being used. + [Newtonsoft.Json.JsonProperty("memo", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Memo + { + get { return _memo; } + set + { + if (_memo != value) + { + _memo = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("receipt", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Receipt + { + get { return _receipt; } + set + { + if (_receipt != value) + { + _receipt = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("r_preimage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] R_preimage + { + get { return _r_preimage; } + set + { + if (_r_preimage != value) + { + _r_preimage = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("r_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] R_hash + { + get { return _r_hash; } + set + { + if (_r_hash != value) + { + _r_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Value + { + get { return _value; } + set + { + if (_value != value) + { + _value = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("settled", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Settled + { + get { return _settled; } + set + { + if (_settled != value) + { + _settled = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("creation_date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Creation_date + { + get { return _creation_date; } + set + { + if (_creation_date != value) + { + _creation_date = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("settle_date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Settle_date + { + get { return _settle_date; } + set + { + if (_settle_date != value) + { + _settle_date = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// A bare-bones invoice for a payment within the Lightning Network. With the + /// details of the invoice, the sender has all the data necessary to send a + /// payment to the recipient. + [Newtonsoft.Json.JsonProperty("payment_request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_request + { + get { return _payment_request; } + set + { + if (_payment_request != value) + { + _payment_request = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// Hash (SHA-256) of a description of the payment. Used if the description of + /// payment (memo) is too long to naturally fit within the description field + /// of an encoded payment request. + [Newtonsoft.Json.JsonProperty("description_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Description_hash + { + get { return _description_hash; } + set + { + if (_description_hash != value) + { + _description_hash = value; + RaisePropertyChanged(); + } + } + } + + /// / Payment request expiry time in seconds. Default is 3600 (1 hour). + [Newtonsoft.Json.JsonProperty("expiry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Expiry + { + get { return _expiry; } + set + { + if (_expiry != value) + { + _expiry = value; + RaisePropertyChanged(); + } + } + } + + /// / Fallback on-chain address. + [Newtonsoft.Json.JsonProperty("fallback_addr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fallback_addr + { + get { return _fallback_addr; } + set + { + if (_fallback_addr != value) + { + _fallback_addr = value; + RaisePropertyChanged(); + } + } + } + + /// / Delta to use for the time-lock of the CLTV extended to the final hop. + [Newtonsoft.Json.JsonProperty("cltv_expiry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Cltv_expiry + { + get { return _cltv_expiry; } + set + { + if (_cltv_expiry != value) + { + _cltv_expiry = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// Route hints that can each be individually used to assist in reaching the + /// invoice's destination. + [Newtonsoft.Json.JsonProperty("route_hints", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Route_hints + { + get { return _route_hints; } + set + { + if (_route_hints != value) + { + _route_hints = value; + RaisePropertyChanged(); + } + } + } + + /// / Whether this invoice should include routing hints for private channels. + [Newtonsoft.Json.JsonProperty("private", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Private + { + get { return _private; } + set + { + if (_private != value) + { + _private = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcInvoice FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcLightningAddress : System.ComponentModel.INotifyPropertyChanged + { + private string _pubkey; + private string _host; + + [Newtonsoft.Json.JsonProperty("pubkey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Pubkey + { + get { return _pubkey; } + set + { + if (_pubkey != value) + { + _pubkey = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("host", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Host + { + get { return _host; } + set + { + if (_host != value) + { + _host = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcLightningAddress FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + /// * + /// An individual vertex/node within the channel graph. A node is + /// connected to other nodes by one or more channel edges emanating from it. As the + /// graph is directed, a node will also have an incoming edge attached to it for + /// each outgoing edge. + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcLightningNode : System.ComponentModel.INotifyPropertyChanged + { + private long? _last_update; + private string _pub_key; + private string _alias; + private System.Collections.ObjectModel.ObservableCollection _addresses; + private string _color; + + [Newtonsoft.Json.JsonProperty("last_update", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Last_update + { + get { return _last_update; } + set + { + if (_last_update != value) + { + _last_update = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pub_key", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Pub_key + { + get { return _pub_key; } + set + { + if (_pub_key != value) + { + _pub_key = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("alias", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Alias + { + get { return _alias; } + set + { + if (_alias != value) + { + _alias = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("addresses", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Addresses + { + get { return _addresses; } + set + { + if (_addresses != value) + { + _addresses = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("color", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Color + { + get { return _color; } + set + { + if (_color != value) + { + _color = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcLightningNode FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcListChannelsResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _channels; + + [Newtonsoft.Json.JsonProperty("channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Channels + { + get { return _channels; } + set + { + if (_channels != value) + { + _channels = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcListChannelsResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcListInvoiceResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _invoices; + + [Newtonsoft.Json.JsonProperty("invoices", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Invoices + { + get { return _invoices; } + set + { + if (_invoices != value) + { + _invoices = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcListInvoiceResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcListPaymentsResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _payments; + + [Newtonsoft.Json.JsonProperty("payments", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Payments + { + get { return _payments; } + set + { + if (_payments != value) + { + _payments = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcListPaymentsResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcListPeersResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _peers; + + [Newtonsoft.Json.JsonProperty("peers", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Peers + { + get { return _peers; } + set + { + if (_peers != value) + { + _peers = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcListPeersResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcNetworkInfo : System.ComponentModel.INotifyPropertyChanged + { + private long? _graph_diameter; + private double? _avg_out_degree; + private long? _max_out_degree; + private long? _num_nodes; + private long? _num_channels; + private string _total_network_capacity; + private double? _avg_channel_size; + private string _min_channel_size; + private string _max_channel_size; + + [Newtonsoft.Json.JsonProperty("graph_diameter", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Graph_diameter + { + get { return _graph_diameter; } + set + { + if (_graph_diameter != value) + { + _graph_diameter = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("avg_out_degree", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double? Avg_out_degree + { + get { return _avg_out_degree; } + set + { + if (_avg_out_degree != value) + { + _avg_out_degree = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("max_out_degree", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Max_out_degree + { + get { return _max_out_degree; } + set + { + if (_max_out_degree != value) + { + _max_out_degree = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_nodes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_nodes + { + get { return _num_nodes; } + set + { + if (_num_nodes != value) + { + _num_nodes = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_channels + { + get { return _num_channels; } + set + { + if (_num_channels != value) + { + _num_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("total_network_capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_network_capacity + { + get { return _total_network_capacity; } + set + { + if (_total_network_capacity != value) + { + _total_network_capacity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("avg_channel_size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double? Avg_channel_size + { + get { return _avg_channel_size; } + set + { + if (_avg_channel_size != value) + { + _avg_channel_size = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("min_channel_size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Min_channel_size + { + get { return _min_channel_size; } + set + { + if (_min_channel_size != value) + { + _min_channel_size = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("max_channel_size", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Max_channel_size + { + get { return _max_channel_size; } + set + { + if (_max_channel_size != value) + { + _max_channel_size = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcNetworkInfo FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcNewAddressResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _address; + + [Newtonsoft.Json.JsonProperty("address", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Address + { + get { return _address; } + set + { + if (_address != value) + { + _address = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcNewAddressResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcNodeAddress : System.ComponentModel.INotifyPropertyChanged + { + private string _network; + private string _addr; + + [Newtonsoft.Json.JsonProperty("network", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Network + { + get { return _network; } + set + { + if (_network != value) + { + _network = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("addr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Addr + { + get { return _addr; } + set + { + if (_addr != value) + { + _addr = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcNodeAddress FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcNodeInfo : System.ComponentModel.INotifyPropertyChanged + { + private LnrpcLightningNode _node; + private long? _num_channels; + private string _total_capacity; + + /// * + /// An individual vertex/node within the channel graph. A node is + /// connected to other nodes by one or more channel edges emanating from it. As + /// the graph is directed, a node will also have an incoming edge attached to + /// it for each outgoing edge. + [Newtonsoft.Json.JsonProperty("node", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcLightningNode Node + { + get { return _node; } + set + { + if (_node != value) + { + _node = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Num_channels + { + get { return _num_channels; } + set + { + if (_num_channels != value) + { + _num_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("total_capacity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_capacity + { + get { return _total_capacity; } + set + { + if (_total_capacity != value) + { + _total_capacity = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcNodeInfo FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcNodeUpdate : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _addresses; + private string _identity_key; + private byte[] _global_features; + private string _alias; + + [Newtonsoft.Json.JsonProperty("addresses", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Addresses + { + get { return _addresses; } + set + { + if (_addresses != value) + { + _addresses = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("identity_key", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Identity_key + { + get { return _identity_key; } + set + { + if (_identity_key != value) + { + _identity_key = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("global_features", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Global_features + { + get { return _global_features; } + set + { + if (_global_features != value) + { + _global_features = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("alias", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Alias + { + get { return _alias; } + set + { + if (_alias != value) + { + _alias = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcNodeUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcOpenChannelRequest : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _node_pubkey; + private string _node_pubkey_string; + private string _local_funding_amount; + private string _push_sat; + private int? _target_conf; + private string _sat_per_byte; + private bool? _private; + private string _min_htlc_msat; + private long? _remote_csv_delay; + + [Newtonsoft.Json.JsonProperty("node_pubkey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Node_pubkey + { + get { return _node_pubkey; } + set + { + if (_node_pubkey != value) + { + _node_pubkey = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("node_pubkey_string", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Node_pubkey_string + { + get { return _node_pubkey_string; } + set + { + if (_node_pubkey_string != value) + { + _node_pubkey_string = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("local_funding_amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Local_funding_amount + { + get { return _local_funding_amount; } + set + { + if (_local_funding_amount != value) + { + _local_funding_amount = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("push_sat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Push_sat + { + get { return _push_sat; } + set + { + if (_push_sat != value) + { + _push_sat = value; + RaisePropertyChanged(); + } + } + } + + /// / The target number of blocks that the funding transaction should be confirmed by. + [Newtonsoft.Json.JsonProperty("target_conf", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Target_conf + { + get { return _target_conf; } + set + { + if (_target_conf != value) + { + _target_conf = value; + RaisePropertyChanged(); + } + } + } + + /// / A manual fee rate set in sat/byte that should be used when crafting the funding transaction. + [Newtonsoft.Json.JsonProperty("sat_per_byte", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Sat_per_byte + { + get { return _sat_per_byte; } + set + { + if (_sat_per_byte != value) + { + _sat_per_byte = value; + RaisePropertyChanged(); + } + } + } + + /// / Whether this channel should be private, not announced to the greater network. + [Newtonsoft.Json.JsonProperty("private", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Private + { + get { return _private; } + set + { + if (_private != value) + { + _private = value; + RaisePropertyChanged(); + } + } + } + + /// / The minimum value in millisatoshi we will require for incoming HTLCs on the channel. + [Newtonsoft.Json.JsonProperty("min_htlc_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Min_htlc_msat + { + get { return _min_htlc_msat; } + set + { + if (_min_htlc_msat != value) + { + _min_htlc_msat = value; + RaisePropertyChanged(); + } + } + } + + /// / The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size. + [Newtonsoft.Json.JsonProperty("remote_csv_delay", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Remote_csv_delay + { + get { return _remote_csv_delay; } + set + { + if (_remote_csv_delay != value) + { + _remote_csv_delay = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcOpenChannelRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcOpenStatusUpdate : System.ComponentModel.INotifyPropertyChanged + { + private LnrpcPendingUpdate _chan_pending; + private LnrpcConfirmationUpdate _confirmation; + private LnrpcChannelOpenUpdate _chan_open; + + [Newtonsoft.Json.JsonProperty("chan_pending", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcPendingUpdate Chan_pending + { + get { return _chan_pending; } + set + { + if (_chan_pending != value) + { + _chan_pending = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("confirmation", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcConfirmationUpdate Confirmation + { + get { return _confirmation; } + set + { + if (_confirmation != value) + { + _confirmation = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("chan_open", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelOpenUpdate Chan_open + { + get { return _chan_open; } + set + { + if (_chan_open != value) + { + _chan_open = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcOpenStatusUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPayReq : System.ComponentModel.INotifyPropertyChanged + { + private string _destination; + private string _payment_hash; + private string _num_satoshis; + private string _timestamp; + private string _expiry; + private string _description; + private string _description_hash; + private string _fallback_addr; + private string _cltv_expiry; + private System.Collections.ObjectModel.ObservableCollection _route_hints; + + [Newtonsoft.Json.JsonProperty("destination", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Destination + { + get { return _destination; } + set + { + if (_destination != value) + { + _destination = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_hash + { + get { return _payment_hash; } + set + { + if (_payment_hash != value) + { + _payment_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_satoshis", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Num_satoshis + { + get { return _num_satoshis; } + set + { + if (_num_satoshis != value) + { + _num_satoshis = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("timestamp", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Timestamp + { + get { return _timestamp; } + set + { + if (_timestamp != value) + { + _timestamp = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("expiry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Expiry + { + get { return _expiry; } + set + { + if (_expiry != value) + { + _expiry = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("description", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Description + { + get { return _description; } + set + { + if (_description != value) + { + _description = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("description_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Description_hash + { + get { return _description_hash; } + set + { + if (_description_hash != value) + { + _description_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fallback_addr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fallback_addr + { + get { return _fallback_addr; } + set + { + if (_fallback_addr != value) + { + _fallback_addr = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("cltv_expiry", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Cltv_expiry + { + get { return _cltv_expiry; } + set + { + if (_cltv_expiry != value) + { + _cltv_expiry = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("route_hints", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Route_hints + { + get { return _route_hints; } + set + { + if (_route_hints != value) + { + _route_hints = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPayReq FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPayment : System.ComponentModel.INotifyPropertyChanged + { + private string _payment_hash; + private string _value; + private string _creation_date; + private System.Collections.ObjectModel.ObservableCollection _path; + private string _fee; + private string _payment_preimage; + + [Newtonsoft.Json.JsonProperty("payment_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_hash + { + get { return _payment_hash; } + set + { + if (_payment_hash != value) + { + _payment_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Value + { + get { return _value; } + set + { + if (_value != value) + { + _value = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("creation_date", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Creation_date + { + get { return _creation_date; } + set + { + if (_creation_date != value) + { + _creation_date = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("path", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Path + { + get { return _path; } + set + { + if (_path != value) + { + _path = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fee", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee + { + get { return _fee; } + set + { + if (_fee != value) + { + _fee = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_preimage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_preimage + { + get { return _payment_preimage; } + set + { + if (_payment_preimage != value) + { + _payment_preimage = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPayment FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPeer : System.ComponentModel.INotifyPropertyChanged + { + private string _pub_key; + private string _address; + private string _bytes_sent; + private string _bytes_recv; + private string _sat_sent; + private string _sat_recv; + private bool? _inbound; + private string _ping_time; + + [Newtonsoft.Json.JsonProperty("pub_key", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Pub_key + { + get { return _pub_key; } + set + { + if (_pub_key != value) + { + _pub_key = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("address", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Address + { + get { return _address; } + set + { + if (_address != value) + { + _address = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("bytes_sent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Bytes_sent + { + get { return _bytes_sent; } + set + { + if (_bytes_sent != value) + { + _bytes_sent = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("bytes_recv", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Bytes_recv + { + get { return _bytes_recv; } + set + { + if (_bytes_recv != value) + { + _bytes_recv = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("sat_sent", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Sat_sent + { + get { return _sat_sent; } + set + { + if (_sat_sent != value) + { + _sat_sent = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("sat_recv", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Sat_recv + { + get { return _sat_recv; } + set + { + if (_sat_recv != value) + { + _sat_recv = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("inbound", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Inbound + { + get { return _inbound; } + set + { + if (_inbound != value) + { + _inbound = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("ping_time", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Ping_time + { + get { return _ping_time; } + set + { + if (_ping_time != value) + { + _ping_time = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPeer FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPendingChannelsResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _total_limbo_balance; + private System.Collections.ObjectModel.ObservableCollection _pending_open_channels; + private System.Collections.ObjectModel.ObservableCollection _pending_closing_channels; + private System.Collections.ObjectModel.ObservableCollection _pending_force_closing_channels; + private System.Collections.ObjectModel.ObservableCollection _waiting_close_channels; + + [Newtonsoft.Json.JsonProperty("total_limbo_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_limbo_balance + { + get { return _total_limbo_balance; } + set + { + if (_total_limbo_balance != value) + { + _total_limbo_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pending_open_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Pending_open_channels + { + get { return _pending_open_channels; } + set + { + if (_pending_open_channels != value) + { + _pending_open_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pending_closing_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Pending_closing_channels + { + get { return _pending_closing_channels; } + set + { + if (_pending_closing_channels != value) + { + _pending_closing_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pending_force_closing_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Pending_force_closing_channels + { + get { return _pending_force_closing_channels; } + set + { + if (_pending_force_closing_channels != value) + { + _pending_force_closing_channels = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("waiting_close_channels", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Waiting_close_channels + { + get { return _waiting_close_channels; } + set + { + if (_waiting_close_channels != value) + { + _waiting_close_channels = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPendingChannelsResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPendingHTLC : System.ComponentModel.INotifyPropertyChanged + { + private bool? _incoming; + private string _amount; + private string _outpoint; + private long? _maturity_height; + private int? _blocks_til_maturity; + private long? _stage; + + [Newtonsoft.Json.JsonProperty("incoming", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Incoming + { + get { return _incoming; } + set + { + if (_incoming != value) + { + _incoming = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amount + { + get { return _amount; } + set + { + if (_amount != value) + { + _amount = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("outpoint", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Outpoint + { + get { return _outpoint; } + set + { + if (_outpoint != value) + { + _outpoint = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("maturity_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Maturity_height + { + get { return _maturity_height; } + set + { + if (_maturity_height != value) + { + _maturity_height = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The number of blocks remaining until the current stage can be swept. + /// Negative values indicate how many blocks have passed since becoming + /// mature. + [Newtonsoft.Json.JsonProperty("blocks_til_maturity", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Blocks_til_maturity + { + get { return _blocks_til_maturity; } + set + { + if (_blocks_til_maturity != value) + { + _blocks_til_maturity = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("stage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Stage + { + get { return _stage; } + set + { + if (_stage != value) + { + _stage = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPendingHTLC FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPendingUpdate : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _txid; + private long? _output_index; + + [Newtonsoft.Json.JsonProperty("txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Txid + { + get { return _txid; } + set + { + if (_txid != value) + { + _txid = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("output_index", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Output_index + { + get { return _output_index; } + set + { + if (_output_index != value) + { + _output_index = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPendingUpdate FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcPolicyUpdateRequest : System.ComponentModel.INotifyPropertyChanged + { + private bool? _global; + private LnrpcChannelPoint _chan_point; + private string _base_fee_msat; + private double? _fee_rate; + private long? _time_lock_delta; + + /// / If set, then this update applies to all currently active channels. + [Newtonsoft.Json.JsonProperty("global", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Global + { + get { return _global; } + set + { + if (_global != value) + { + _global = value; + RaisePropertyChanged(); + } + } + } + + /// / If set, this update will target a specific channel. + [Newtonsoft.Json.JsonProperty("chan_point", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcChannelPoint Chan_point + { + get { return _chan_point; } + set + { + if (_chan_point != value) + { + _chan_point = value; + RaisePropertyChanged(); + } + } + } + + /// / The base fee charged regardless of the number of milli-satoshis sent. + [Newtonsoft.Json.JsonProperty("base_fee_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Base_fee_msat + { + get { return _base_fee_msat; } + set + { + if (_base_fee_msat != value) + { + _base_fee_msat = value; + RaisePropertyChanged(); + } + } + } + + /// / The effective fee rate in milli-satoshis. The precision of this value goes up to 6 decimal places, so 1e-6. + [Newtonsoft.Json.JsonProperty("fee_rate", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public double? Fee_rate + { + get { return _fee_rate; } + set + { + if (_fee_rate != value) + { + _fee_rate = value; + RaisePropertyChanged(); + } + } + } + + /// / The required timelock delta for HTLCs forwarded over the channel. + [Newtonsoft.Json.JsonProperty("time_lock_delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Time_lock_delta + { + get { return _time_lock_delta; } + set + { + if (_time_lock_delta != value) + { + _time_lock_delta = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcPolicyUpdateRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcQueryRoutesResponse : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _routes; + + [Newtonsoft.Json.JsonProperty("routes", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Routes + { + get { return _routes; } + set + { + if (_routes != value) + { + _routes = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcQueryRoutesResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + /// * + /// A path through the channel graph which runs over one or more channels in + /// succession. This struct carries all the information required to craft the + /// Sphinx onion packet, and send the payment along the first hop in the path. A + /// route is only selected as valid if all the channels have sufficient capacity to + /// carry the initial payment amount after fees are accounted for. + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcRoute : System.ComponentModel.INotifyPropertyChanged + { + private long? _total_time_lock; + private string _total_fees; + private string _total_amt; + private System.Collections.ObjectModel.ObservableCollection _hops; + private string _total_fees_msat; + private string _total_amt_msat; + + /// * + /// The cumulative (final) time lock across the entire route. This is the CLTV + /// value that should be extended to the first hop in the route. All other hops + /// will decrement the time-lock as advertised, leaving enough time for all + /// hops to wait for or present the payment preimage to complete the payment. + [Newtonsoft.Json.JsonProperty("total_time_lock", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Total_time_lock + { + get { return _total_time_lock; } + set + { + if (_total_time_lock != value) + { + _total_time_lock = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The sum of the fees paid at each hop within the final route. In the case + /// of a one-hop payment, this value will be zero as we don't need to pay a fee + /// it ourself. + [Newtonsoft.Json.JsonProperty("total_fees", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_fees + { + get { return _total_fees; } + set + { + if (_total_fees != value) + { + _total_fees = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total amount of funds required to complete a payment over this route. + /// This value includes the cumulative fees at each hop. As a result, the HTLC + /// extended to the first-hop in the route will need to have at least this many + /// satoshis, otherwise the route will fail at an intermediate node due to an + /// insufficient amount of fees. + [Newtonsoft.Json.JsonProperty("total_amt", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_amt + { + get { return _total_amt; } + set + { + if (_total_amt != value) + { + _total_amt = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// Contains details concerning the specific forwarding details at each hop. + [Newtonsoft.Json.JsonProperty("hops", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Hops + { + get { return _hops; } + set + { + if (_hops != value) + { + _hops = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total fees in millisatoshis. + [Newtonsoft.Json.JsonProperty("total_fees_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_fees_msat + { + get { return _total_fees_msat; } + set + { + if (_total_fees_msat != value) + { + _total_fees_msat = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// The total amount in millisatoshis. + [Newtonsoft.Json.JsonProperty("total_amt_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_amt_msat + { + get { return _total_amt_msat; } + set + { + if (_total_amt_msat != value) + { + _total_amt_msat = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcRoute FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcRouteHint : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _hop_hints; + + /// * + /// A list of hop hints that when chained together can assist in reaching a + /// specific destination. + [Newtonsoft.Json.JsonProperty("hop_hints", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Hop_hints + { + get { return _hop_hints; } + set + { + if (_hop_hints != value) + { + _hop_hints = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcRouteHint FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcRoutingPolicy : System.ComponentModel.INotifyPropertyChanged + { + private long? _time_lock_delta; + private string _min_htlc; + private string _fee_base_msat; + private string _fee_rate_milli_msat; + + [Newtonsoft.Json.JsonProperty("time_lock_delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public long? Time_lock_delta + { + get { return _time_lock_delta; } + set + { + if (_time_lock_delta != value) + { + _time_lock_delta = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("min_htlc", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Min_htlc + { + get { return _min_htlc; } + set + { + if (_min_htlc != value) + { + _min_htlc = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fee_base_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_base_msat + { + get { return _fee_base_msat; } + set + { + if (_fee_base_msat != value) + { + _fee_base_msat = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("fee_rate_milli_msat", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Fee_rate_milli_msat + { + get { return _fee_rate_milli_msat; } + set + { + if (_fee_rate_milli_msat != value) + { + _fee_rate_milli_msat = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcRoutingPolicy FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSendCoinsRequest : System.ComponentModel.INotifyPropertyChanged + { + private string _addr; + private string _amount; + private int? _target_conf; + private string _sat_per_byte; + + [Newtonsoft.Json.JsonProperty("addr", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Addr + { + get { return _addr; } + set + { + if (_addr != value) + { + _addr = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amount + { + get { return _amount; } + set + { + if (_amount != value) + { + _amount = value; + RaisePropertyChanged(); + } + } + } + + /// / The target number of blocks that this transaction should be confirmed by. + [Newtonsoft.Json.JsonProperty("target_conf", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Target_conf + { + get { return _target_conf; } + set + { + if (_target_conf != value) + { + _target_conf = value; + RaisePropertyChanged(); + } + } + } + + /// / A manual fee rate set in sat/byte that should be used when crafting the transaction. + [Newtonsoft.Json.JsonProperty("sat_per_byte", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Sat_per_byte + { + get { return _sat_per_byte; } + set + { + if (_sat_per_byte != value) + { + _sat_per_byte = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSendCoinsRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSendCoinsResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _txid; + + [Newtonsoft.Json.JsonProperty("txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Txid + { + get { return _txid; } + set + { + if (_txid != value) + { + _txid = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSendCoinsResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSendManyResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _txid; + + [Newtonsoft.Json.JsonProperty("txid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Txid + { + get { return _txid; } + set + { + if (_txid != value) + { + _txid = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSendManyResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSendRequest : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _dest; + private string _dest_string; + private string _amt; + private byte[] _payment_hash; + private string _payment_hash_string; + private string _payment_request; + private int? _final_cltv_delta; + + [Newtonsoft.Json.JsonProperty("dest", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Dest + { + get { return _dest; } + set + { + if (_dest != value) + { + _dest = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("dest_string", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Dest_string + { + get { return _dest_string; } + set + { + if (_dest_string != value) + { + _dest_string = value; + RaisePropertyChanged(); + } + } + } + + /// / Number of satoshis to send. + [Newtonsoft.Json.JsonProperty("amt", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amt + { + get { return _amt; } + set + { + if (_amt != value) + { + _amt = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Payment_hash + { + get { return _payment_hash; } + set + { + if (_payment_hash != value) + { + _payment_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_hash_string", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_hash_string + { + get { return _payment_hash_string; } + set + { + if (_payment_hash_string != value) + { + _payment_hash_string = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// A bare-bones invoice for a payment within the Lightning Network. With the + /// details of the invoice, the sender has all the data necessary to send a + /// payment to the recipient. + [Newtonsoft.Json.JsonProperty("payment_request", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_request + { + get { return _payment_request; } + set + { + if (_payment_request != value) + { + _payment_request = value; + RaisePropertyChanged(); + } + } + } + + /// / The CLTV delta from the current height that should be used to set the timelock for the final hop. + [Newtonsoft.Json.JsonProperty("final_cltv_delta", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Final_cltv_delta + { + get { return _final_cltv_delta; } + set + { + if (_final_cltv_delta != value) + { + _final_cltv_delta = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSendRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSendResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _payment_error; + private byte[] _payment_preimage; + private LnrpcRoute _payment_route; + + [Newtonsoft.Json.JsonProperty("payment_error", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Payment_error + { + get { return _payment_error; } + set + { + if (_payment_error != value) + { + _payment_error = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_preimage", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Payment_preimage + { + get { return _payment_preimage; } + set + { + if (_payment_preimage != value) + { + _payment_preimage = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("payment_route", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public LnrpcRoute Payment_route + { + get { return _payment_route; } + set + { + if (_payment_route != value) + { + _payment_route = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSendResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcSignMessageResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _signature; + + [Newtonsoft.Json.JsonProperty("signature", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Signature + { + get { return _signature; } + set + { + if (_signature != value) + { + _signature = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcSignMessageResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcTransaction : System.ComponentModel.INotifyPropertyChanged + { + private string _tx_hash; + private string _amount; + private int? _num_confirmations; + private string _block_hash; + private int? _block_height; + private string _time_stamp; + private string _total_fees; + private System.Collections.ObjectModel.ObservableCollection _dest_addresses; + + [Newtonsoft.Json.JsonProperty("tx_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Tx_hash + { + get { return _tx_hash; } + set + { + if (_tx_hash != value) + { + _tx_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Amount + { + get { return _amount; } + set + { + if (_amount != value) + { + _amount = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("num_confirmations", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Num_confirmations + { + get { return _num_confirmations; } + set + { + if (_num_confirmations != value) + { + _num_confirmations = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("block_hash", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Block_hash + { + get { return _block_hash; } + set + { + if (_block_hash != value) + { + _block_hash = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("block_height", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Block_height + { + get { return _block_height; } + set + { + if (_block_height != value) + { + _block_height = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("time_stamp", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Time_stamp + { + get { return _time_stamp; } + set + { + if (_time_stamp != value) + { + _time_stamp = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("total_fees", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_fees + { + get { return _total_fees; } + set + { + if (_total_fees != value) + { + _total_fees = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("dest_addresses", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Dest_addresses + { + get { return _dest_addresses; } + set + { + if (_dest_addresses != value) + { + _dest_addresses = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcTransaction FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcTransactionDetails : System.ComponentModel.INotifyPropertyChanged + { + private System.Collections.ObjectModel.ObservableCollection _transactions; + + /// / The list of transactions relevant to the wallet. + [Newtonsoft.Json.JsonProperty("transactions", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public System.Collections.ObjectModel.ObservableCollection Transactions + { + get { return _transactions; } + set + { + if (_transactions != value) + { + _transactions = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcTransactionDetails FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcUnlockWalletRequest : System.ComponentModel.INotifyPropertyChanged + { + private byte[] _wallet_password; + private int? _recovery_window; + + /// * + /// wallet_password should be the current valid passphrase for the daemon. This + /// will be required to decrypt on-disk material that the daemon requires to + /// function properly. + [Newtonsoft.Json.JsonProperty("wallet_password", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public byte[] Wallet_password + { + get { return _wallet_password; } + set + { + if (_wallet_password != value) + { + _wallet_password = value; + RaisePropertyChanged(); + } + } + } + + /// * + /// recovery_window is an optional argument specifying the address lookahead + /// when restoring a wallet seed. The recovery window applies to each + /// invdividual branch of the BIP44 derivation paths. Supplying a recovery + /// window of zero indicates that no addresses should be recovered, such after + /// the first initialization of the wallet. + [Newtonsoft.Json.JsonProperty("recovery_window", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public int? Recovery_window + { + get { return _recovery_window; } + set + { + if (_recovery_window != value) + { + _recovery_window = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcUnlockWalletRequest FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcVerifyMessageResponse : System.ComponentModel.INotifyPropertyChanged + { + private bool? _valid; + private string _pubkey; + + [Newtonsoft.Json.JsonProperty("valid", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? Valid + { + get { return _valid; } + set + { + if (_valid != value) + { + _valid = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("pubkey", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Pubkey + { + get { return _pubkey; } + set + { + if (_pubkey != value) + { + _pubkey = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcVerifyMessageResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "9.9.11.0 (Newtonsoft.Json v9.0.0.0)")] + public partial class LnrpcWalletBalanceResponse : System.ComponentModel.INotifyPropertyChanged + { + private string _total_balance; + private string _confirmed_balance; + private string _unconfirmed_balance; + + [Newtonsoft.Json.JsonProperty("total_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Total_balance + { + get { return _total_balance; } + set + { + if (_total_balance != value) + { + _total_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("confirmed_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Confirmed_balance + { + get { return _confirmed_balance; } + set + { + if (_confirmed_balance != value) + { + _confirmed_balance = value; + RaisePropertyChanged(); + } + } + } + + [Newtonsoft.Json.JsonProperty("unconfirmed_balance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public string Unconfirmed_balance + { + get { return _unconfirmed_balance; } + set + { + if (_unconfirmed_balance != value) + { + _unconfirmed_balance = value; + RaisePropertyChanged(); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + public string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this); + } + + public static LnrpcWalletBalanceResponse FromJson(string data) + { + return Newtonsoft.Json.JsonConvert.DeserializeObject(data); + } + + protected virtual void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.11.1.0")] + public class SwaggerException : System.Exception + { + public string StatusCode { get; private set; } + + public string Response { get; private set; } + + public System.Collections.Generic.Dictionary> Headers { get; private set; } + + public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary> headers, System.Exception innerException) + : base(message, innerException) + { + StatusCode = statusCode; + Response = response; + Headers = headers; + + Debug.WriteLine($"SwaggerException: {response}"); + } + + public override string ToString() + { + return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); + } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "11.11.1.0")] + public class SwaggerException : SwaggerException + { + public TResult Result { get; private set; } + + public SwaggerException(string message, string statusCode, string response, System.Collections.Generic.Dictionary> headers, TResult result, System.Exception innerException) + : base(message, statusCode, response, headers, innerException) + { + Result = result; + } + } + +} diff --git a/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClientCustomHttp.cs b/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClientCustomHttp.cs new file mode 100644 index 000000000..18a67f219 --- /dev/null +++ b/BTCPayServer/Payments/Lightning/Lnd/LndSwaggerClientCustomHttp.cs @@ -0,0 +1,163 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.Http; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using NBitcoin; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace BTCPayServer.Payments.Lightning.Lnd +{ + public class LndSwaggerClientCustomHttp : LndSwaggerClient, IDisposable + { + protected LndSwaggerClientCustomHttp(string baseUrl, HttpClient httpClient) + : base(baseUrl, httpClient) + { + _HttpClient = httpClient; + } + + private HttpClient _HttpClient; + + public void Dispose() + { + _HttpClient.Dispose(); + } + + // + public static LndSwaggerClientCustomHttp Create(Uri uri, Network network, byte[] tlsCertificate = null, byte[] grpcMacaroon = null) + { + var factory = new HttpClientFactoryForLnd(tlsCertificate, grpcMacaroon); + var httpClient = factory.Generate(); + + var swagger = new LndSwaggerClientCustomHttp(uri.ToString().TrimEnd('/'), httpClient); + swagger.HttpClientFactory = factory; + + return swagger; + } + } + + internal class HttpClientFactoryForLnd + { + public HttpClientFactoryForLnd(byte[] tlsCertificate = null, byte[] grpcMacaroon = null) + { + TlsCertificate = tlsCertificate; + GrpcMacaroon = grpcMacaroon; + } + + public byte[] TlsCertificate { get; set; } + public byte[] GrpcMacaroon { get; set; } + + public HttpClient Generate() + { + var httpClient = new HttpClient(GetCertificate(TlsCertificate)); + + if (GrpcMacaroon != null) + { + var macaroonHex = BitConverter.ToString(GrpcMacaroon).Replace("-", "", StringComparison.InvariantCulture); + httpClient.DefaultRequestHeaders.Add("Grpc-Metadata-macaroon", macaroonHex); + } + + return httpClient; + } + + private static HttpClientHandler GetCertificate(byte[] certFile) + { + var handler = new HttpClientHandler + { + SslProtocols = SslProtocols.Tls12 + }; + if (certFile == null) + { + handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator; + return handler; + } + + // if certificate is not null, try with custom accepting logic + X509Certificate2 clientCertificate = null; + if (certFile != null) + clientCertificate = new X509Certificate2(certFile); + + handler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) => + { + const SslPolicyErrors unforgivableErrors = + SslPolicyErrors.RemoteCertificateNotAvailable | + SslPolicyErrors.RemoteCertificateNameMismatch; + + if ((errors & unforgivableErrors) != 0) + { + return false; + } + + if (clientCertificate == null) + return true; + + X509Certificate2 remoteRoot = chain.ChainElements[chain.ChainElements.Count - 1].Certificate; + var res = clientCertificate.RawData.SequenceEqual(remoteRoot.RawData); + + return res; + }; + + return handler; + } + } + + public partial class LndSwaggerClient + { + internal HttpClientFactoryForLnd HttpClientFactory { get; set; } + + public TaskCompletionSource InvoiceResponse = new TaskCompletionSource(); + public TaskCompletionSource SubscribeLost = new TaskCompletionSource(); + + // TODO: Refactor swagger generated wrapper to include this method directly + public async Task StartSubscribeInvoiceThread(CancellationToken token) + { + var urlBuilder = new StringBuilder(); + urlBuilder.Append(BaseUrl).Append("/v1/invoices/subscribe"); + + using (var client = HttpClientFactory.Generate()) + { + client.Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite); + + var request = new HttpRequestMessage(HttpMethod.Get, urlBuilder.ToString()); + + using (var response = await client.SendAsync( + request, HttpCompletionOption.ResponseHeadersRead, token)) + { + using (var body = await response.Content.ReadAsStreamAsync()) + using (var reader = new StreamReader(body)) + { + try + { + while (!reader.EndOfStream) + { + string line = reader.ReadLine(); + if (line != null && line.Contains("\"result\":", StringComparison.OrdinalIgnoreCase)) + { + dynamic parsedJson = JObject.Parse(line); + var result = parsedJson.result; + var invoiceString = result.ToString(); + LnrpcInvoice parsedInvoice = JsonConvert.DeserializeObject(invoiceString, _settings.Value); + InvoiceResponse.SetResult(parsedInvoice); + } + } + } + catch (Exception e) + { + // TODO: check that the exception type is actually from a closed stream. + Debug.WriteLine(e.Message); + SubscribeLost.SetResult(this); + } + } + } + } + } + } +}