From a44dd6c6072705043b81feb53c66fef544d9bd0b Mon Sep 17 00:00:00 2001 From: pushist1y Date: Thu, 22 Mar 2018 12:03:52 +0300 Subject: [PATCH] added support for estimatesmartfee method --- src/BitcoinLib/Responses/EstimateSmartFeeResponse.cs | 11 +++++++++++ .../Services/RpcServices/RpcService/IRpcService.cs | 1 + .../Services/RpcServices/RpcService/RpcService.cs | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 src/BitcoinLib/Responses/EstimateSmartFeeResponse.cs diff --git a/src/BitcoinLib/Responses/EstimateSmartFeeResponse.cs b/src/BitcoinLib/Responses/EstimateSmartFeeResponse.cs new file mode 100644 index 0000000..b192313 --- /dev/null +++ b/src/BitcoinLib/Responses/EstimateSmartFeeResponse.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic; + +namespace BitcoinLib.Responses +{ + public class EstimateSmartFeeResponse + { + public decimal? FeeRate { get; set; } + public uint? Blocks { get; set; } + public IList Errors { get; set; } + } +} diff --git a/src/BitcoinLib/Services/RpcServices/RpcService/IRpcService.cs b/src/BitcoinLib/Services/RpcServices/RpcService/IRpcService.cs index 7653a8e..233f27c 100644 --- a/src/BitcoinLib/Services/RpcServices/RpcService/IRpcService.cs +++ b/src/BitcoinLib/Services/RpcServices/RpcService/IRpcService.cs @@ -89,6 +89,7 @@ public interface IRpcService CreateMultiSigResponse CreateMultiSig(int nRquired, List publicKeys); decimal EstimateFee(ushort nBlocks); + EstimateSmartFeeResponse EstimateSmartFee(ushort nBlocks); decimal EstimatePriority(ushort nBlocks); // estimatesmartfee // estimatesmartpriority diff --git a/src/BitcoinLib/Services/RpcServices/RpcService/RpcService.cs b/src/BitcoinLib/Services/RpcServices/RpcService/RpcService.cs index 63d6cd5..9eb423b 100644 --- a/src/BitcoinLib/Services/RpcServices/RpcService/RpcService.cs +++ b/src/BitcoinLib/Services/RpcServices/RpcService/RpcService.cs @@ -101,6 +101,11 @@ public decimal EstimateFee(ushort nBlocks) return _rpcConnector.MakeRequest(RpcMethods.estimatefee, nBlocks); } + public EstimateSmartFeeResponse EstimateSmartFee(ushort nBlocks) + { + return _rpcConnector.MakeRequest(RpcMethods.estimatesmartfee, nBlocks); + } + public decimal EstimatePriority(ushort nBlocks) { return _rpcConnector.MakeRequest(RpcMethods.estimatepriority, nBlocks);