Sha256: 72be5937a859a92107716a6aee0c9220150e4286fec4382ddabb275e35509199

Contents?: true

Size: 1.67 KB

Versions: 3

Compression:

Stored size: 1.67 KB

Contents

require 'bitcoin'
require 'logger'
require 'active_support/core_ext'

module Mastercoin
  class TransactionNotFoundException < StandardError;end
  autoload :SimpleSend, 'mastercoin-ruby/simple_send'
  autoload :SellingOffer, 'mastercoin-ruby/selling_offer'
  autoload :ExodusPayment, 'mastercoin-ruby/exodus_payment'
  autoload :Transaction, 'mastercoin-ruby/transaction'
  autoload :Message, 'mastercoin-ruby/message'
  autoload :PurchaseOffer, 'mastercoin-ruby/purchase_offer'
  autoload :Util, 'mastercoin-ruby/util'
  autoload :BitcoinWrapper, 'mastercoin-ruby/bitcoin_wrapper'

  TRANSACTION_SIMPLE_SEND = "0"
  TRANSACTION_SELL_FOR_BITCOIN = 20
  TRANSACTION_PURCHASE_BTC_TRADE = 22

  TRANSACTION_TYPES = {
    TRANSACTION_SIMPLE_SEND => "Simple transfer",
    "10" => "Mark saving",
    "11" => "Mark compromised",
    TRANSACTION_SELL_FOR_BITCOIN => "Currency trade offer bitcoins",
    "21" => "Currency trade offer master-coin derived",
    TRANSACTION_PURCHASE_BTC_TRADE  => "Currency trade offer accept",
    "30" => "Register data-stream",
    "40" => "Bet offer",
    "100" => "Create child currency"
  }

  CURRENCY_IDS = {
    "1" => "Mastercoin",
    "2" => "Test Mastercoin"
  }

  EXODUS_ADDRESS = "1EXoDusjGwvnjZUyKkxZ4UHEf77z6A5S4P"
  END_TIME = 1377993874
  END_BLOCK = 255365

  def self.set_storage(storage_string)
    @storage_string = storage_string
  end

  def self.storage
    Bitcoin.network ||= :bitcoin
    @@storage ||= Bitcoin::Storage.sequel(:db => @storage_string)
    return @@storage
  end

  def self.init_logger(level = Logger::DEBUG)
    @@log ||= Logger.new(STDOUT)
    @@log.level = level
    @@log
  end

  def self.log
    @@log ||= Mastercoin.init_logger
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mastercoin-ruby-0.2.9 lib/mastercoin-ruby.rb
mastercoin-ruby-0.2.8 lib/mastercoin-ruby.rb
mastercoin-ruby-0.2.7 lib/mastercoin-ruby.rb