Module: BTC::AssetTransactionBuilder::Provider

Included in:
BlockProvider
Defined in:
lib/btcruby/open_assets/asset_transaction_builder/provider.rb

Overview

Interface for providing unspent asset outputs to the asset transaction builder. You can use it instead of Enumerable attribute asset_unspent_outputs to customize which unspents to be used.

Defined Under Namespace

Classes: BlockProvider

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(&block) ⇒ Object

Creates a block-based provider: atxbuilder.provider = AssetTransactionBuilder::Provider.new {|builder| [...] }



17
18
19
# File 'lib/btcruby/open_assets/asset_transaction_builder/provider.rb', line 17

def self.new(&block)
  BlockProvider.new(&block)
end

Instance Method Details

#asset_unspent_outputs(asset_id: nil, amount: nil) ⇒ Object

Returns an Enumerable object yielding unspent asset outputs for the given asset ID and amount. Each unspent output is a BTC::AssetTransactionOutput instance with non-nil transaction_hash, index, asset_id, value attributes. Additional information about outputs and fees may be used to optimize the set of unspents.



11
12
13
# File 'lib/btcruby/open_assets/asset_transaction_builder/provider.rb', line 11

def asset_unspent_outputs(asset_id: nil, amount: nil)
  []
end