@@ -736,6 +736,71 @@ interface Bolt11Invoice {
736
736
PublicKey recover_payee_pub_key();
737
737
};
738
738
739
+ [Enum]
740
+ interface OfferAmount {
741
+ Bitcoin(u64 amount_msats);
742
+ Currency(string iso4217_code, u64 amount);
743
+ };
744
+
745
+ [Traits=(Debug, Display, Eq)]
746
+ interface Offer {
747
+ [Throws=NodeError, Name=from_str]
748
+ constructor([ByRef] string offer_str);
749
+ OfferId id();
750
+ boolean is_expired();
751
+ string? description();
752
+ string? issuer();
753
+ OfferAmount? amount();
754
+ boolean is_valid_quantity(u64 quantity);
755
+ boolean expects_quantity();
756
+ boolean supports_chain(Network chain);
757
+ sequence<Network> chains();
758
+ sequence<u8>? metadata();
759
+ u64? absolute_expiry_seconds();
760
+ PublicKey? issuer_signing_pubkey();
761
+ };
762
+
763
+ [Traits=(Debug, Display, Eq)]
764
+ interface Refund {
765
+ [Throws=NodeError, Name=from_str]
766
+ constructor([ByRef] string refund_str);
767
+ string description();
768
+ u64? absolute_expiry_seconds();
769
+ boolean is_expired();
770
+ string? issuer();
771
+ sequence<u8> payer_metadata();
772
+ Network? chain();
773
+ u64 amount_msats();
774
+ u64? quantity();
775
+ PublicKey payer_signing_pubkey();
776
+ string? payer_note();
777
+ };
778
+
779
+ interface Bolt12Invoice {
780
+ [Throws=NodeError, Name=from_str]
781
+ constructor([ByRef] string invoice_str);
782
+ PaymentHash payment_hash();
783
+ u64 amount_msats();
784
+ OfferAmount? amount();
785
+ PublicKey signing_pubkey();
786
+ u64 created_at();
787
+ u64? absolute_expiry_seconds();
788
+ u64 relative_expiry();
789
+ boolean is_expired();
790
+ string? description();
791
+ string? issuer();
792
+ string? payer_note();
793
+ sequence<u8>? metadata();
794
+ u64? quantity();
795
+ sequence<u8> signable_hash();
796
+ PublicKey payer_signing_pubkey();
797
+ PublicKey? issuer_signing_pubkey();
798
+ sequence<u8> chain();
799
+ sequence<sequence<u8>>? offer_chains();
800
+ sequence<Address> fallback_addresses();
801
+ sequence<u8> encode();
802
+ };
803
+
739
804
[Custom]
740
805
typedef string Txid;
741
806
@@ -754,15 +819,6 @@ typedef string NodeId;
754
819
[Custom]
755
820
typedef string Address;
756
821
757
- [Custom]
758
- typedef string Offer;
759
-
760
- [Custom]
761
- typedef string Refund;
762
-
763
- [Custom]
764
- typedef string Bolt12Invoice;
765
-
766
822
[Custom]
767
823
typedef string OfferId;
768
824
0 commit comments