Module: Counterparty

Defined in:
lib/counterparty_ruby.rb,
lib/counterparty/version.rb,
lib/counterparty/resource.rb,
lib/counterparty/resources.rb,
lib/counterparty/tx_decode.rb,
lib/counterparty/tx_encode.rb,
lib/counterparty/connection.rb

Overview

Defined Under Namespace

Classes: BTCPay, Balance, Bet, BetExpiration, BetMatch, BetMatchExpiration, Broadcast, Burn, Callback, Cancel, Connection, CounterResource, Credit, Debit, Dividend, Execute, Issuance, JsonResponseError, Message, Order, OrderExpiration, OrderMatch, OrderMatchExpiration, Publish, ResponseError, Send, TxDecode, TxEncode

Constant Summary collapse

ONE_XCP =

One XCP, in units of Satoshi

100_000_000
ONE_BTC =

One BTC, in units of Satoshi

100_000_000
VERSION =

The library version string

"1.2.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.bitcoinObject

Returns the current default bitcoin object, or creates a new test-mode connection, if none has been defined



67
68
69
# File 'lib/counterparty_ruby.rb', line 67

def bitcoin
  @bitcoin || BlockrIo.new
end

.connectionObject

Returns the current default connection object, or creates a new test-mode connection, if none has been defined



61
62
63
# File 'lib/counterparty_ruby.rb', line 61

def connection
  @connection || Connection.new
end

Class Method Details

.production!Object

Establishes the default connection for new objects as being the default counterparty production mode port/user/ip



73
74
75
76
# File 'lib/counterparty_ruby.rb', line 73

def production!
  @connection = Connection.new 
  @bitcoin = BlockrIo.new
end

.test!Object

Establishes the default connection for new objects as being the default counterparty test mode port/user/ip



80
81
82
83
# File 'lib/counterparty_ruby.rb', line 80

def test!
  @connection = Connection.new 14000
  @bitcoin = BlockrIo.new true
end