Beispiel #1
0
        public async Task <OffchainResponse> Finalize(FinalizeData data)
        {
            var request = new FinalizeChannelModel(data.ClientPubKey, data.AssetId, data.ClientRevokePubKey, data.SignedByClientHubCommitment, !string.IsNullOrWhiteSpace(data.ExternalTransferId) ? Guid.Parse(data.ExternalTransferId) : (Guid?)null, !string.IsNullOrWhiteSpace(data.OffchainTransferId) ? Guid.Parse(data.OffchainTransferId) : (Guid?)null);

            var response = await _apiClient.ApiOffchainFinalizePostAsync(request);

            return(PrepareFinalizeOffchainResult(response));
        }
        public async Task <FinalizeOffchainApiResponse> Finalize([FromBody] FinalizeChannelModel model)
        {
            var asset = await GetAsset(model.Asset);

            var tr = await _offchain.Finalize(model.ClientPubKey, asset, model.ClientRevokePubKey, model.SignedByClientHubCommitment, model.TransferId,
                                              model.NotifyTxId);

            return(new FinalizeOffchainApiResponse(tr));
        }
 /// <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> ApiOffchainFinalizePostAsync(this IBitcoinApi operations, FinalizeChannelModel model = default(FinalizeChannelModel), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.ApiOffchainFinalizePostWithHttpMessagesAsync(model, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 public static object ApiOffchainFinalizePost(this IBitcoinApi operations, FinalizeChannelModel model = default(FinalizeChannelModel))
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IBitcoinApi)s).ApiOffchainFinalizePostAsync(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 ApiOffchainFinalizePost(this IBitcoinApi operations, FinalizeChannelModel model = default(FinalizeChannelModel))
 {
     return(operations.ApiOffchainFinalizePostAsync(model).GetAwaiter().GetResult());
 }