Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
feat(BUX-149): documentation of fee quotes (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-4chain authored Aug 16, 2023
1 parent 3d7f23c commit e78219a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions broadcast/fee_quotes.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
package broadcast

// PolicyQuoteResponse is the response returned by the GetPolicyQuote method.
type PolicyQuoteResponse struct {
// Miner is the URL of the miner that returned the policy quote.
Miner string `json:"miner"`
// Policy is a detailed policy of the miner.
Policy PolicyResponse `json:"policy"`
// Timestamp is the timestamp of the policy quote response received.
Timestamp string `json:"timestamp"`
}

// FeeQuote is the response returned by the GetFeeQuote method.
type FeeQuote struct {
// Miner is the URL of the miner that returned the fee quote.
Miner string `json:"miner"`
// MiningFee is expressed by number of satoshis per number of bytes.
MiningFee MiningFeeResponse `json:"miningFee"`
// Timestamp is the timestamp of the fee quote response received.
Timestamp string `json:"timestamp"`
}

type PolicyResponse struct {
// MaxScriptSizePolicy is the maximum number of bytes of the script in a single transaction.
MaxScriptSizePolicy int64 `json:"maxscriptsizepolicy"`
// MaxTxSigOpsCountPolicy is the maximum allowed number of signature operations in a single transaction
MaxTxSigOpsCountPolicy int64 `json:"maxtxsigopscountspolicy"`
// MaxTxSizePolicy is the maximum size in bytes of a single transaction.
MaxTxSizePolicy int64 `json:"maxtxsizepolicy"`
// MiningFee is expressed by number of satoshis per number of bytes.
MiningFee MiningFeeResponse `json:"miningFee"`
}

type MiningFeeResponse struct {
// Bytes is the number of bytes per which a number of satoshis is charged as transaction fee.
Bytes int64 `json:"bytes"`
// Satoshis is the number of satoshis charged as transaction fee per the number of bytes.
Satoshis int64 `json:"satoshis"`
}
1 change: 1 addition & 0 deletions examples/get_fee_quote/get_fee_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
broadcast_client "github.com/bitcoin-sv/go-broadcast-client/broadcast/broadcast-client"
)

// This example shows how to get a fee quote.
func main() {
taalCfg := broadcast_client.ArcClientConfig{
Token: "",
Expand Down
1 change: 1 addition & 0 deletions examples/get_policy_quote/get_policy_quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
broadcast_client "github.com/bitcoin-sv/go-broadcast-client/broadcast/broadcast-client"
)

// This example shows how to get a policy quote.
func main() {
taalCfg := broadcast_client.ArcClientConfig{
Token: "",
Expand Down

0 comments on commit e78219a

Please sign in to comment.