Class: BSV::Network::BroadcastResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/bsv/network/broadcast_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ BroadcastResponse

Returns a new instance of BroadcastResponse.



9
10
11
12
13
14
15
16
17
18
# File 'lib/bsv/network/broadcast_response.rb', line 9

def initialize(attrs = {})
  @txid = attrs[:txid]
  @tx_status = attrs[:tx_status]
  @message = attrs[:message]
  @extra_info = attrs[:extra_info]
  @block_hash = attrs[:block_hash]
  @block_height = attrs[:block_height]
  @timestamp = attrs[:timestamp]
  @competing_txs = attrs[:competing_txs]
end

Instance Attribute Details

#block_hashObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def block_hash
  @block_hash
end

#block_heightObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def block_height
  @block_height
end

#competing_txsObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def competing_txs
  @competing_txs
end

#extra_infoObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def extra_info
  @extra_info
end

#messageObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def message
  @message
end

#timestampObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def timestamp
  @timestamp
end

#tx_statusObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def tx_status
  @tx_status
end

#txidObject (readonly)

ARC API boundary: display-order hex txid as returned by the ARC broadcast endpoint.



7
8
9
# File 'lib/bsv/network/broadcast_response.rb', line 7

def txid
  @txid
end

Instance Method Details

#mined?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/bsv/network/broadcast_response.rb', line 24

def mined?
  tx_status == 'MINED'
end

#success?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/bsv/network/broadcast_response.rb', line 20

def success?
  true
end