From 18fe4da9899b74fe143b7e27e6c9aa050e1afbe4 Mon Sep 17 00:00:00 2001 From: Ben Carman Date: Wed, 8 Jul 2020 10:22:59 -0500 Subject: [PATCH] Fee Provider Docs (#1641) --- docs/fee-provider/fee-provider.md | 21 +++++++++++++++++++++ website/sidebars.json | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 docs/fee-provider/fee-provider.md diff --git a/docs/fee-provider/fee-provider.md b/docs/fee-provider/fee-provider.md new file mode 100644 index 0000000000..26b4244cdc --- /dev/null +++ b/docs/fee-provider/fee-provider.md @@ -0,0 +1,21 @@ +--- +id: fee-provider +title: Fee Provider +--- + +# Fee Provider + +Bitcoin-S has a `FeeProvider` that is used to fetch fee rates. +Currently, Bitcoin-s has a couple implemented, one being a `BitcoindRpcClient`, which will use `estimateSmartFee` to calculate a fee rate. +Another uses [bitcoiner.live's api](https://bitcoiner.live/) to get a fee rate. + +Any `FeeProvider` can be passed to a `Wallet` which will be used to calculate fees for transactions when one is not specified. + +## HttpFeeRateProvider + +A `HttpFeeRateProvider` is a `FeeProvider` that uses an outside API to get fee rates. +These can be hooked up to any website's API as long as you can provide a `URI` and a function to convert the response to a `FeeUnit`. + +There also exists `CachedHttpFeeRateProvider`, which will cache the response for the `cacheDuration` as to prevent hitting request limits and save on api calls. + +Checkout [`BitcoinerLiveFeeRateProvider`'s implementation](https://github.com/bitcoin-s/bitcoin-s/blob/master/fee-provider/src/main/scala/org/bitcoins/feeprovider/BitcoinerLiveFeeRateProvider.scala) for an example. diff --git a/website/sidebars.json b/website/sidebars.json index 5e5956e2be..caa8fb6e39 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -28,6 +28,9 @@ "crypto/crypto-intro", "crypto/sign" ], + "Fee Provider": [ + "fee-provider/fee-provider" + ], "Key Manager": [ "key-manager/key-manager" ],