Sha256: c96163dffc474c169d8650d0c2f2ab536e0abe78c5b406606cb175fb6277b68b

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

require 'bitcoin'
require 'logger'

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

  TRANSACTION_SIMPLE_SEND = "0"

  TRANSACTION_TYPES = {
    TRANSACTION_SIMPLE_SEND => "Simple transfer",
    "10" => "Mark saving",
    "11" => "Mark compromised",
    "20" => "Currency trade offer bitcoins",
    "21" => "Currency trade offer master-coin derived",
    "22" => "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 = Time.new(2013,9,01,00,00,00, "+00:00")
  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::INFO)
    @@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.0.4 lib/mastercoin-ruby.rb
mastercoin-ruby-0.0.3 lib/mastercoin-ruby.rb
mastercoin-ruby-0.0.2 lib/mastercoin-ruby.rb