From 75a90170644adcf1a5f5543af7783b72e78c68f0 Mon Sep 17 00:00:00 2001 From: Kuba <127198012+kuba-4chain@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:53:29 +0200 Subject: [PATCH] feat(BUX-149): readme-docs (#19) * feat(BUX-149): readme-docs * fix: indentation --- README.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b9d4db1..657bc0a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ - [x] [Query Transaction Status](https://bitcoin-sv.github.io/arc/api.html#/Arc/GET%20transaction%20status) - [x] [Submit Transaction](https://bitcoin-sv.github.io/arc/api.html#/Arc/POST%20transaction) - [x] [Submit Batch Transactions](https://bitcoin-sv.github.io/arc/api.html#/Arc/POST%20transactions) - - [ ] Quote Services -> WORK IN PROGRESS + - [x] [Quote Services](https://bitcoin-sv.github.io/arc/api.html#/Arc/GET%20policy) ## What is library doing? @@ -129,6 +129,26 @@ When you created your own client, you can use the method `QueryTx` to query the // ... ``` +### Get Policy Quote Method + +Having your client created, you can use the method `GetPolicyQuote` to get a slice of policy quotes from all the nodes configured in your client. + +```go +// ... +policyQuotes, err := client.GetPolicyQuote(context.Background()) +// ... +``` + +### Get Fee Quote Method + +Having your client created, you can use the method `GetFeeQuote` to get a slice of fee quotes (which are subsets from PolicyQuotes) from all the nodes configured in your client. + +```go +// ... +feeQuotes, err := client.GetFeeQuote(context.Background()) +// ... +``` + ### SubmitTx Method Having your client created, you can use the method `SubmitTx` to submit a single transaction to the node. @@ -190,6 +210,50 @@ type QueryTxResponse struct { } ``` +### PolicyQuote + +#### PolicyQuoteResponse + +```go +type PolicyQuoteResponse struct { + Miner string `json:"miner"` + Policy PolicyResponse `json:"policy"` + Timestamp string `json:"timestamp"` +} +``` + +#### PolicyResponse + +```go +type PolicyResponse struct { + MaxScriptSizePolicy int64 `json:"maxscriptsizepolicy"` + MaxTxSigOpsCountPolicy int64 `json:"maxtxsigopscountspolicy"` + MaxTxSizePolicy int64 `json:"maxtxsizepolicy"` + MiningFee MiningFeeResponse `json:"miningFee"` +} +``` + +#### MiningFeeResponse + +```go +type MiningFeeResponse struct { + Bytes int64 `json:"bytes"` + Satoshis int64 `json:"satoshis"` +} +``` + +### FeeQuote + +#### FeeQuoteResponse + +```go +type FeeQuote struct { + Miner string `json:"miner"` + MiningFee MiningFeeResponse `json:"miningFee"` + Timestamp string `json:"timestamp"` +} +``` + ### SubmitTx #### SubmitTxResponse