Method: OpenAssets::Api#issue_asset

Defined in:
lib/openassets/api.rb

#issue_asset(from, amount, metadata = nil, to = nil, fees = nil, mode = 'broadcast', output_qty = 1) ⇒ Object

Creates a transaction for issuing an asset. @param from The open asset address to issue the asset from. @param amount The amount of asset units to issue. @param to The open asset address to send the asset to; if unspecified, the assets are sent back to the issuing address. @param metadata The metadata to embed in the transaction. The asset definition pointer defined by this metadata. @param fees The fess in satoshis for the transaction. @param mode Specify the following mode. ‘broadcast’ (default) for signing and broadcasting the transaction, ‘signed’ for signing the transaction without broadcasting, ‘unsigned’ for getting the raw unsigned transaction without broadcasting“”“=‘broadcast’ @param output_qty The number of divides the issue output. Default value is 1. Ex. amount = 125 and output_qty = 2, asset quantity = [62, 63] and issue TxOut is two. @return The Bitcoin::Tx object.



99
100
101
102
103
104
105
106
# File 'lib/openassets/api.rb', line 99

def issue_asset(from, amount,  = nil, to = nil, fees = nil, mode = 'broadcast', output_qty = 1)
  to = from if to.nil?
  colored_outputs = get_unspent_outputs([oa_address_to_address(from)])
  issue_param = OpenAssets::Transaction::TransferParameters.new(colored_outputs, to, from, amount, output_qty)
  tx = create_tx_builder.issue_asset(issue_param, , fees.nil? ? @config[:default_fees]: fees)
  tx = process_transaction(tx, mode)
  tx
end