Module: Coloredcoins

Defined in:
lib/coloredcoins.rb,
lib/coloredcoins/api.rb,
lib/coloredcoins/version.rb,
lib/coloredcoins/multisig.rb,
lib/coloredcoins/connection.rb,
lib/coloredcoins/multisig_tx.rb,
lib/coloredcoins/transaction.rb

Defined Under Namespace

Classes: API, Connection, Multisig, MultisigTx, Transaction

Constant Summary collapse

InvalidSignatureError =
Class.new SecurityError
ConnectionError =
Class.new StandardError
InvalidKeyError =
Class.new RuntimeError
API_VERSION =
'v3'.freeze
NETS =
[
  MAINNET = 'mainnet'.freeze,
  TESTNET = 'testnet'.freeze
].freeze
VERSION =
'0.0.3'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#api=(value) ⇒ Object (writeonly)

Sets the attribute api

Parameters:

  • value

    the value to set the attribute api to.



11
12
13
# File 'lib/coloredcoins.rb', line 11

def api=(value)
  @api = value
end

Class Method Details

.apiObject



23
24
25
# File 'lib/coloredcoins.rb', line 23

def self.api
  @api ||= API.new(network, API_VERSION)
end

.method_missing(sym, *args, &block) ⇒ Object



36
37
38
# File 'lib/coloredcoins.rb', line 36

def self.method_missing(sym, *args, &block)
  api.send(sym, *args, &block)
end

.networkObject



27
28
29
# File 'lib/coloredcoins.rb', line 27

def self.network
  @network || MAINNET
end

.network=(network) ⇒ Object



31
32
33
34
# File 'lib/coloredcoins.rb', line 31

def self.network=(network)
  @network = network
  @api = API.new(network, API_VERSION)
end