class Straight::AddressProvider::Base

Attributes

gateway[R]

Public Class Methods

new(gateway) click to toggle source
# File lib/straight/address_providers/base.rb, line 7
def initialize(gateway)
  @gateway = gateway
end

Public Instance Methods

new_address(keychain_id:, **args) click to toggle source

@param [Hash] args see GatewayModule::Includable#new_order @return [String] bitcoin address 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.

# File lib/straight/address_providers/base.rb, line 17
def new_address(keychain_id:, **args)
  raise NotImplementedError
end
takes_fees?() click to toggle source

If this method returns true, then address provider is expected to define new_address_and_amount which returns ['address', Integer(amount in satoshi)]

# File lib/straight/address_providers/base.rb, line 23
def takes_fees?
  false
end