Ejemplo n.º 1
0
        public async Task <OffchainBaseResponse> CloseChannel(CloseChannelData data)
        {
            var request = new BroadcastClosingChannelModel(data.ClientPubKey, data.AssetId, data.SignedClosingTransaction, !string.IsNullOrWhiteSpace(data.OffchainTransferId) ? Guid.Parse(data.OffchainTransferId) : (Guid?)null);

            var response = await _apiClient.ApiOffchainBroadcastclosingPostAsync(request);

            return(PrepareOffchainTransactionHashResult(response));
        }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <object> ApiOffchainBroadcastclosingPostAsync(this IBitcoinApi operations, BroadcastClosingChannelModel model = default(BroadcastClosingChannelModel), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ApiOffchainBroadcastclosingPostWithHttpMessagesAsync(model, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 3
0
        public async Task <TransactionHashResponse> BroadcastClosing([FromBody] BroadcastClosingChannelModel model)
        {
            var asset = await GetAsset(model.Asset);

            return(new TransactionHashResponse(await _offchain.BroadcastClosingChannel(model.ClientPubKey, asset, model.SignedByClientTransaction, model.NotifyTxId)));
        }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 public static object ApiOffchainBroadcastclosingPost(this IBitcoinApi operations, BroadcastClosingChannelModel model = default(BroadcastClosingChannelModel))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IBitcoinApi)s).ApiOffchainBroadcastclosingPostAsync(model), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 public static object ApiOffchainBroadcastclosingPost(this IBitcoinApi operations, BroadcastClosingChannelModel model = default(BroadcastClosingChannelModel))
 {
     return(operations.ApiOffchainBroadcastclosingPostAsync(model).GetAwaiter().GetResult());
 }