Class: Lightning::Invoice::RoutingInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/lightning/invoice/routing_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pubkey, short_channel_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta) ⇒ RoutingInfo

Returns a new instance of RoutingInfo.



6
7
8
9
10
11
12
# File 'lib/lightning/invoice/routing_info.rb', line 6

def initialize(pubkey, short_channel_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta)
  @pubkey = pubkey
  @short_channel_id = short_channel_id
  @fee_base_msat = fee_base_msat
  @fee_proportional_millionths = fee_proportional_millionths
  @cltv_expiry_delta = cltv_expiry_delta
end

Instance Attribute Details

#cltv_expiry_deltaObject

Returns the value of attribute cltv_expiry_delta.



4
5
6
# File 'lib/lightning/invoice/routing_info.rb', line 4

def cltv_expiry_delta
  @cltv_expiry_delta
end

#fee_base_msatObject

Returns the value of attribute fee_base_msat.



4
5
6
# File 'lib/lightning/invoice/routing_info.rb', line 4

def fee_base_msat
  @fee_base_msat
end

#fee_proportional_millionthsObject

Returns the value of attribute fee_proportional_millionths.



4
5
6
# File 'lib/lightning/invoice/routing_info.rb', line 4

def fee_proportional_millionths
  @fee_proportional_millionths
end

#pubkeyObject

Returns the value of attribute pubkey.



4
5
6
# File 'lib/lightning/invoice/routing_info.rb', line 4

def pubkey
  @pubkey
end

#short_channel_idObject

Returns the value of attribute short_channel_id.



4
5
6
# File 'lib/lightning/invoice/routing_info.rb', line 4

def short_channel_id
  @short_channel_id
end

Instance Method Details

#to_arrayObject



14
15
16
17
18
19
20
# File 'lib/lightning/invoice/routing_info.rb', line 14

def to_array
  pubkey.htb.unpack("C*") +
  short_channel_id.htb.unpack("C*") +
  Invoice.int_to_array(fee_base_msat, 5, 4) +
  Invoice.int_to_array(fee_proportional_millionths, 5, 4) +
  Invoice.int_to_array(cltv_expiry_delta)
end