Class: Glueby::Contract::FeeEstimator::Auto

Inherits:
Object
  • Object
show all
Includes:
Glueby::Contract::FeeEstimator
Defined in:
lib/glueby/contract/fee_estimator/auto.rb

Overview

It calculates actual minimum fee to broadcast txs.

Constant Summary collapse

DEFAULT_FEE_RATE =

This is same with Tapyrus Core’s default min_relay_fee value.(tapyrus/kB)

1_000

Class Attribute Summary collapse

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Glueby::Contract::FeeEstimator

dummy_tx, #fee

Constructor Details

#initialize(fee_rate: Auto.default_fee_rate || DEFAULT_FEE_RATE) ⇒ Auto

Returns a new instance of Auto.

Parameters:

  • fee_rate (Integer) (defaults to: Auto.default_fee_rate || DEFAULT_FEE_RATE)


22
23
24
# File 'lib/glueby/contract/fee_estimator/auto.rb', line 22

def initialize(fee_rate: Auto.default_fee_rate || DEFAULT_FEE_RATE)
  @fee_rate = fee_rate
end

Class Attribute Details

.default_fee_rateInteger

Returns The global fee rate configuration. All instances use this value as the default.

Returns:

  • (Integer)

    The global fee rate configuration. All instances use this value as the default.



18
19
20
# File 'lib/glueby/contract/fee_estimator/auto.rb', line 18

def default_fee_rate
  @default_fee_rate
end

Instance Attribute Details

#fee_rateObject (readonly)

Returns the value of attribute fee_rate.



13
14
15
# File 'lib/glueby/contract/fee_estimator/auto.rb', line 13

def fee_rate
  @fee_rate
end