Class: Counterparty::Bet

Inherits:
CounterResource show all
Defined in:
lib/counterparty/resources.rb

Overview

An object that describes a specific bet.

Constant Summary collapse

BULLISH_CFD =

Bet Type: Bullish CFD

0
BEARISH_CFD =

Bet Type: Bearish CFD

1
EQUAL =

Bet Type: Equal

2
NOT_EQUAL =

Bet Type: Not Equal

3
LEVERAGE_BASIS =

Denominator by which the leverage integer is divided by. It's effectively a 'magic' number that allows us to keep the leverage parameter an integer

5040

Instance Attribute Summary collapse

Attributes inherited from CounterResource

#allow_unconfirmed_inputs, #encoding, #fee, #fee_per_kb, #pubkey, #result_attributes

Method Summary

Methods inherited from CounterResource

#==, api_name, bitcoin, find, #initialize, #save!, to_create_request, to_get_request, #to_raw_tx, #to_signed_tx

Constructor Details

This class inherits a constructor from Counterparty::CounterResource

Instance Attribute Details

#bet_typeObject

(integer): 0 for Bullish CFD, 1 for Bearish CFD, 2 for Equal, 3 for Not Equal


50
51
52
# File 'lib/counterparty/resources.rb', line 50

def bet_type
  @bet_type
end

#block_indexObject

(integer): The block index (block number in the block chain)


40
41
42
# File 'lib/counterparty/resources.rb', line 40

def block_index
  @block_index
end

#counterwager_quantityObject

(integer): The minimum quantity of XCP to be wagered against, for the bets to match. (Only used in Create)


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

def counterwager_quantity
  @counterwager_quantity
end

#deadlineObject

(integer): The timestamp at which the bet should be decided/settled, in Unix time.


54
55
56
# File 'lib/counterparty/resources.rb', line 54

def deadline
  @deadline
end

#expirationObject

(integer): The number of blocks for which the bet should be valid


76
77
78
# File 'lib/counterparty/resources.rb', line 76

def expiration
  @expiration
end

#fee_multiplierObject

(integer):


79
80
81
# File 'lib/counterparty/resources.rb', line 79

def fee_multiplier
  @fee_multiplier
end

#feed_addressObject

(string): The address with the feed that the bet is to be made on


46
47
48
# File 'lib/counterparty/resources.rb', line 46

def feed_address
  @feed_address
end

#leverageObject

(integer): Leverage, as a fraction of 5040


73
74
75
# File 'lib/counterparty/resources.rb', line 73

def leverage
  @leverage
end

#oddsObject

(float):


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

def odds
  @odds
end

#sourceObject

(string): The address that made the bet


43
44
45
# File 'lib/counterparty/resources.rb', line 43

def source
  @source
end

#target_valueObject

(float): Target value for Equal/NotEqual bet


70
71
72
# File 'lib/counterparty/resources.rb', line 70

def target_value
  @target_value
end

#tx_hashObject

(string): The transaction hash


37
38
39
# File 'lib/counterparty/resources.rb', line 37

def tx_hash
  @tx_hash
end

#tx_indexObject

(integer): The transaction index


34
35
36
# File 'lib/counterparty/resources.rb', line 34

def tx_index
  @tx_index
end

#validityObject

(string): Set to “valid” if a valid bet. Any other setting signifies an invalid/improper bet


83
84
85
# File 'lib/counterparty/resources.rb', line 83

def validity
  @validity
end

#wager_quantityObject

(integer): The quantity of XCP to wager. (Only used in Create)


57
58
59
# File 'lib/counterparty/resources.rb', line 57

def wager_quantity
  @wager_quantity
end

#wager_remainingObject

(integer): The quantity of XCP wagered that is remaining to bet on


64
65
66
# File 'lib/counterparty/resources.rb', line 64

def wager_remaining
  @wager_remaining
end