public async Task <string> ReceiveAsync(LightMoney amount, string description = null) { if (amount == null) { throw new ArgumentNullException(nameof(amount)); } List <object> args = new List <object>(); args.Add(amount.MilliSatoshi); if (description != null) { args.Add(description); } return((await SendCommandAsync(new RPCRequest("receive", args.ToArray())).ConfigureAwait(false)).ResultString); }
public async Task <string> OpenAsync(NodeInfo node, Money fundingSatoshi, LightMoney pushAmount = null) { if (fundingSatoshi == null) { throw new ArgumentNullException(nameof(fundingSatoshi)); } if (node == null) { throw new ArgumentNullException(nameof(node)); } pushAmount = pushAmount ?? LightMoney.Zero; var result = await SendCommandAsync(new RPCRequest("open", new object[] { node.NodeId, node.Host, node.Port, fundingSatoshi.Satoshi, pushAmount.MilliSatoshi })); return(result.ResultString); }
public string Receive(LightMoney amount, string description = null) { return(ReceiveAsync(amount, description).GetAwaiter().GetResult()); }
public string Open(NodeInfo node, Money fundingSatoshi, LightMoney pushAmount = null) { return(OpenAsync(node, fundingSatoshi, pushAmount).GetAwaiter().GetResult()); }