Class: Straight::AddressProvider::Base
- Inherits:
-
Object
- Object
- Straight::AddressProvider::Base
- Defined in:
- lib/straight/address_providers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
Instance Method Summary collapse
-
#initialize(gateway) ⇒ Base
constructor
A new instance of Base.
-
#new_address(keychain_id:, **args) ⇒ String
Returns a Base58-encoded Bitcoin address to which the payment transaction is expected to arrive.
-
#takes_fees? ⇒ Boolean
If this method returns true, then address provider is expected to define #new_address_and_amount which returns [‘address’, Integer(amount in satoshi)].
Constructor Details
#initialize(gateway) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/straight/address_providers/base.rb', line 7 def initialize(gateway) @gateway = gateway end |
Instance Attribute Details
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
5 6 7 |
# File 'lib/straight/address_providers/base.rb', line 5 def gateway @gateway end |
Instance Method Details
#new_address(keychain_id:, **args) ⇒ String
Returns a Base58-encoded Bitcoin address to which the payment transaction is expected to arrive. keychain_id is an integer > 0 (hopefully not too large and hopefully the one a user of this class is going to properly increment) that is used to generate a an BIP32 bitcoin address deterministically.
17 18 19 |
# File 'lib/straight/address_providers/base.rb', line 17 def new_address(keychain_id:, **args) raise NotImplementedError end |
#takes_fees? ⇒ Boolean
If this method returns true, then address provider is expected to define #new_address_and_amount which returns [‘address’, Integer(amount in satoshi)]
23 24 25 |
# File 'lib/straight/address_providers/base.rb', line 23 def takes_fees? false end |