diff --git a/lib/bolt11/lnaddr.rb b/lib/bolt11/lnaddr.rb index 5b8cd9d..41a0496 100644 --- a/lib/bolt11/lnaddr.rb +++ b/lib/bolt11/lnaddr.rb @@ -1,21 +1,24 @@ -class LnAddr - attr_accessor :currency, :amount, :multiplier, :timestamp, - :pubkey, :signature, :short_description, :description, - :payment_hash, :description_hash, :expiry, :routing_info +module Bolt11 + class LnAddr + attr_accessor :currency, :amount, :multiplier, :timestamp, + :pubkey, :signature, :short_description, :description, + :payment_hash, :description_hash, :expiry, :routing_info - def initialize - @currency = "" - @amount = nil - @multiplier = nil - @timestamp = nil - @unknown_tags = [] - @payment_hash = nil - @pubkey = nil - @signature = nil - @short_description = nil - @description = nil - @description_hash = nil - @expiry = nil - @routing_info = nil + def initialize + @currency = "" + @amount = nil + @multiplier = nil + @timestamp = nil + @unknown_tags = [] + @payment_hash = nil + @pubkey = nil + @signature = nil + @short_description = nil + @description = nil + @description_hash = nil + @expiry = nil + @fallback_addr = nil + @routing_info = [] + end end end \ No newline at end of file diff --git a/lib/bolt11/routing_info.rb b/lib/bolt11/routing_info.rb new file mode 100644 index 0000000..716c369 --- /dev/null +++ b/lib/bolt11/routing_info.rb @@ -0,0 +1,13 @@ +module Bolt11 + class RoutingInfo + attr_accessor :pubkey, :short_channel_id, :fee_base_msat, :fee_proportional_millionths, :cltv_expiry_delta + + 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 + end +end \ No newline at end of file