Class: Glueby::Configuration
- Inherits:
-
Object
- Object
- Glueby::Configuration
- Defined in:
- lib/glueby/configuration.rb
Overview
Global configuration on runtime
The global configuration treats configurations for all modules in Glueby.
Defined Under Namespace
Modules: Errors
Instance Attribute Summary collapse
-
#fee_provider_bears ⇒ Object
(also: #fee_provider_bears?)
readonly
Returns the value of attribute fee_provider_bears.
-
#use_utxo_provider ⇒ Object
(also: #use_utxo_provider?)
readonly
Returns the value of attribute use_utxo_provider.
Instance Method Summary collapse
-
#default_fee_rate=(fee_rate) ⇒ Object
Set default fee rate to the FeeEstimator::Auto.
-
#default_fixed_fee=(fee) ⇒ Object
Set default fixed fee to the FeeEstimator::Fixed.
-
#disable_fee_provider_bears! ⇒ Object
Use This to disable to use FeeProvider.
-
#disable_utxo_provider! ⇒ Object
Disable UtxoProvider feature.
-
#enable_utxo_provider! ⇒ Object
Enable UtxoProvider feature.
-
#fee_provider_bears! ⇒ Object
Use This to enable to use FeeProvider to supply inputs for fees on each transaction that is created on Glueby.
-
#fee_provider_config=(config) ⇒ Object
Specify FeeProvider configuration.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#rpc_config=(config) ⇒ Object
Specify connection information to Tapyrus Core RPC.
-
#utxo_provider_config=(config) ⇒ Object
Set UtxoProvider configuration.
-
#wallet_adapter=(adapter) ⇒ Object
Specify wallet adapter.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 |
# File 'lib/glueby/configuration.rb', line 21 def initialize @fee_provider_bears = false @use_utxo_provider = false end |
Instance Attribute Details
#fee_provider_bears ⇒ Object (readonly) Also known as: fee_provider_bears?
Returns the value of attribute fee_provider_bears.
13 14 15 |
# File 'lib/glueby/configuration.rb', line 13 def fee_provider_bears @fee_provider_bears end |
#use_utxo_provider ⇒ Object (readonly) Also known as: use_utxo_provider?
Returns the value of attribute use_utxo_provider.
13 14 15 |
# File 'lib/glueby/configuration.rb', line 13 def use_utxo_provider @use_utxo_provider end |
Instance Method Details
#default_fee_rate=(fee_rate) ⇒ Object
Set default fee rate to the FeeEstimator::Auto
96 97 98 |
# File 'lib/glueby/configuration.rb', line 96 def default_fee_rate=(fee_rate) Contract::FeeEstimator::Auto.default_fee_rate = fee_rate end |
#default_fixed_fee=(fee) ⇒ Object
Set default fixed fee to the FeeEstimator::Fixed
90 91 92 |
# File 'lib/glueby/configuration.rb', line 90 def default_fixed_fee=(fee) Contract::FeeEstimator::Fixed.default_fixed_fee = fee end |
#disable_fee_provider_bears! ⇒ Object
Use This to disable to use FeeProvider
58 59 60 |
# File 'lib/glueby/configuration.rb', line 58 def disable_fee_provider_bears! @fee_provider_bears = false end |
#disable_utxo_provider! ⇒ Object
Disable UtxoProvider feature
76 77 78 |
# File 'lib/glueby/configuration.rb', line 76 def disable_utxo_provider! @use_utxo_provider = false end |
#enable_utxo_provider! ⇒ Object
Enable UtxoProvider feature
71 72 73 |
# File 'lib/glueby/configuration.rb', line 71 def enable_utxo_provider! @use_utxo_provider = true end |
#fee_provider_bears! ⇒ Object
Use This to enable to use FeeProvider to supply inputs for fees on each transaction that is created on Glueby.
53 54 55 |
# File 'lib/glueby/configuration.rb', line 53 def fee_provider_bears! @fee_provider_bears = true end |
#fee_provider_config=(config) ⇒ Object
Specify FeeProvider configuration.
66 67 68 |
# File 'lib/glueby/configuration.rb', line 66 def fee_provider_config=(config) FeeProvider.configure(config) end |
#rpc_config=(config) ⇒ Object
Specify connection information to Tapyrus Core RPC.
48 49 50 |
# File 'lib/glueby/configuration.rb', line 48 def rpc_config=(config) Glueby::Internal::RPC.configure(config) end |
#utxo_provider_config=(config) ⇒ Object
Set UtxoProvider configuration
84 85 86 |
# File 'lib/glueby/configuration.rb', line 84 def utxo_provider_config=(config) UtxoProvider.configure(config) end |
#wallet_adapter=(adapter) ⇒ Object
Specify wallet adapter.
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/glueby/configuration.rb', line 28 def wallet_adapter=(adapter) case adapter when :core Glueby::Internal::Wallet.wallet_adapter = Glueby::Internal::Wallet::TapyrusCoreWalletAdapter.new when :activerecord Glueby::Internal::Wallet.wallet_adapter = Glueby::Internal::Wallet::ActiveRecordWalletAdapter.new when :mysql Glueby::Internal::Wallet.wallet_adapter = Glueby::Internal::Wallet::MySQLWalletAdapter.new else raise 'Not implemented' end end |