Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public string Receive(LightMoney amount, string description = null)
 {
     return(ReceiveAsync(amount, description).GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 public string Open(NodeInfo node, Money fundingSatoshi, LightMoney pushAmount = null)
 {
     return(OpenAsync(node, fundingSatoshi, pushAmount).GetAwaiter().GetResult());
 }