@@ -44,7 +44,10 @@ pub use lightning_liquidity::lsps0::ser::LSPSDateTime;
4444pub use lightning_liquidity:: lsps1:: msgs:: {
4545 LSPS1ChannelInfo , LSPS1OrderId , LSPS1OrderParams , LSPS1PaymentState ,
4646} ;
47- use lightning_types:: features:: { InitFeatures as LdkInitFeatures , NodeFeatures as LdkNodeFeatures } ;
47+ use lightning_types:: features:: {
48+ ChannelTypeFeatures as LdkChannelTypeFeatures , InitFeatures as LdkInitFeatures ,
49+ NodeFeatures as LdkNodeFeatures ,
50+ } ;
4851pub use lightning_types:: payment:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
4952pub use lightning_types:: string:: UntrustedString ;
5053use vss_client:: headers:: {
@@ -1817,6 +1820,82 @@ impl From<LdkNodeFeatures> for NodeFeatures {
18171820 }
18181821}
18191822
1823+ #[ derive( Debug , Clone , PartialEq , Eq , uniffi:: Object ) ]
1824+ #[ uniffi:: export( Debug , Eq ) ]
1825+ pub struct ChannelTypeFeatures {
1826+ pub ( crate ) inner : LdkChannelTypeFeatures ,
1827+ }
1828+
1829+ #[ uniffi:: export]
1830+ impl ChannelTypeFeatures {
1831+ /// Constructs channel type features from big-endian BOLT 9 encoded bytes.
1832+ #[ uniffi:: constructor]
1833+ pub fn from_bytes ( bytes : & [ u8 ] ) -> Self {
1834+ Self { inner : LdkChannelTypeFeatures :: from_be_bytes ( bytes. to_vec ( ) ) }
1835+ }
1836+
1837+ /// Returns the BOLT 9 big-endian encoded representation of these features.
1838+ pub fn to_bytes ( & self ) -> Vec < u8 > {
1839+ self . inner . encode ( )
1840+ }
1841+
1842+ /// Whether this channel type advertises support for `option_static_remotekey`.
1843+ pub fn supports_static_remote_key ( & self ) -> bool {
1844+ self . inner . supports_static_remote_key ( )
1845+ }
1846+
1847+ /// Whether this channel type requires `option_static_remotekey`.
1848+ pub fn requires_static_remote_key ( & self ) -> bool {
1849+ self . inner . requires_static_remote_key ( )
1850+ }
1851+
1852+ /// Whether this channel type advertises support for `option_anchors_zero_fee_htlc_tx`.
1853+ pub fn supports_anchors_zero_fee_htlc_tx ( & self ) -> bool {
1854+ self . inner . supports_anchors_zero_fee_htlc_tx ( )
1855+ }
1856+
1857+ /// Whether this channel type requires `option_anchors_zero_fee_htlc_tx`.
1858+ pub fn requires_anchors_zero_fee_htlc_tx ( & self ) -> bool {
1859+ self . inner . requires_anchors_zero_fee_htlc_tx ( )
1860+ }
1861+
1862+ /// Whether this channel type advertises support for `option_anchors_nonzero_fee_htlc_tx`.
1863+ pub fn supports_anchors_nonzero_fee_htlc_tx ( & self ) -> bool {
1864+ self . inner . supports_anchors_nonzero_fee_htlc_tx ( )
1865+ }
1866+
1867+ /// Whether this channel type requires `option_anchors_nonzero_fee_htlc_tx`.
1868+ pub fn requires_anchors_nonzero_fee_htlc_tx ( & self ) -> bool {
1869+ self . inner . requires_anchors_nonzero_fee_htlc_tx ( )
1870+ }
1871+
1872+ /// Whether this channel type advertises support for `option_taproot`.
1873+ pub fn supports_taproot ( & self ) -> bool {
1874+ self . inner . supports_taproot ( )
1875+ }
1876+
1877+ /// Whether this channel type requires `option_taproot`.
1878+ pub fn requires_taproot ( & self ) -> bool {
1879+ self . inner . requires_taproot ( )
1880+ }
1881+
1882+ /// Whether this channel type advertises support for `option_zero_fee_commitments`.
1883+ pub fn supports_anchor_zero_fee_commitments ( & self ) -> bool {
1884+ self . inner . supports_anchor_zero_fee_commitments ( )
1885+ }
1886+
1887+ /// Whether this channel type requires `option_zero_fee_commitments`.
1888+ pub fn requires_anchor_zero_fee_commitments ( & self ) -> bool {
1889+ self . inner . requires_anchor_zero_fee_commitments ( )
1890+ }
1891+ }
1892+
1893+ impl From < LdkChannelTypeFeatures > for ChannelTypeFeatures {
1894+ fn from ( features : LdkChannelTypeFeatures ) -> Self {
1895+ Self { inner : features }
1896+ }
1897+ }
1898+
18201899#[ derive( Debug , Clone , PartialEq , Eq , uniffi:: Object ) ]
18211900#[ uniffi:: export( Debug , Eq ) ]
18221901pub struct InitFeatures {
0 commit comments