Class: Lightning::Invoice::RoutingInfo
- Inherits:
-
Object
- Object
- Lightning::Invoice::RoutingInfo
- Defined in:
- lib/lightning/invoice/routing_info.rb
Instance Attribute Summary collapse
-
#cltv_expiry_delta ⇒ Object
Returns the value of attribute cltv_expiry_delta.
-
#fee_base_msat ⇒ Object
Returns the value of attribute fee_base_msat.
-
#fee_proportional_millionths ⇒ Object
Returns the value of attribute fee_proportional_millionths.
-
#pubkey ⇒ Object
Returns the value of attribute pubkey.
-
#short_channel_id ⇒ Object
Returns the value of attribute short_channel_id.
Instance Method Summary collapse
-
#initialize(pubkey, short_channel_id, fee_base_msat, fee_proportional_millionths, cltv_expiry_delta) ⇒ RoutingInfo
constructor
A new instance of RoutingInfo.
- #to_array ⇒ Object
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_delta ⇒ Object
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_msat ⇒ Object
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_millionths ⇒ Object
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 |
#pubkey ⇒ Object
Returns the value of attribute pubkey.
4 5 6 |
# File 'lib/lightning/invoice/routing_info.rb', line 4 def pubkey @pubkey end |
#short_channel_id ⇒ Object
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_array ⇒ Object
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 |