X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Finclude%2Flightning.h;h=c2bf71a27f5da2a030e1ac7a1c91201e267b38ef;hb=84d87f57e92f8da5f8d7cb3c2abaa2feea595bf9;hp=199061182ee70e78dea19a26fb157907d6bf32b2;hpb=732c5112d4ccdb93005dce8652d6eadaad454d71;p=ldk-c-bindings diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 1990611..c2bf71a 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -347,6 +347,24 @@ typedef struct LDKCResult_TxCreationKeysErrorZ { bool result_ok; } LDKCResult_TxCreationKeysErrorZ; +typedef enum LDKCOption_u32Z_Tag { + LDKCOption_u32Z_Some, + LDKCOption_u32Z_None, + /** + * Must be last for serialization purposes + */ + LDKCOption_u32Z_Sentinel, +} LDKCOption_u32Z_Tag; + +typedef struct LDKCOption_u32Z { + LDKCOption_u32Z_Tag tag; + union { + struct { + uint32_t some; + }; + }; +} LDKCOption_u32Z; + /** @@ -1682,6 +1700,24 @@ typedef struct LDKCResult_ChannelConfigDecodeErrorZ { bool result_ok; } LDKCResult_ChannelConfigDecodeErrorZ; +typedef enum LDKCOption_u64Z_Tag { + LDKCOption_u64Z_Some, + LDKCOption_u64Z_None, + /** + * Must be last for serialization purposes + */ + LDKCOption_u64Z_Sentinel, +} LDKCOption_u64Z_Tag; + +typedef struct LDKCOption_u64Z { + LDKCOption_u64Z_Tag tag; + union { + struct { + uint64_t some; + }; + }; +} LDKCOption_u64Z; + /** @@ -5058,6 +5094,14 @@ struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDK void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); +struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); + +struct LDKCOption_u32Z COption_u32Z_none(void); + +void COption_u32Z_free(struct LDKCOption_u32Z _res); + +struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig); + struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o); struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e); @@ -5210,6 +5254,14 @@ void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecod struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); +struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); + +struct LDKCOption_u64Z COption_u64Z_none(void); + +void COption_u64Z_free(struct LDKCOption_u64Z _res); + +struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); + struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_ok(struct LDKDirectionalChannelInfo o); struct LDKCResult_DirectionalChannelInfoDecodeErrorZ CResult_DirectionalChannelInfoDecodeErrorZ_err(struct LDKDecodeError e); @@ -5368,6 +5420,10 @@ void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig); +struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o); + +struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void); + void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res); struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); @@ -7162,6 +7218,18 @@ const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NO */ void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ +struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + +/** + * The position of the funding transaction in the chain. None if the funding transaction has + * not yet been confirmed and the channel fully opened. + */ +void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + /** * The node_id of our counterparty */ @@ -10332,6 +10400,25 @@ const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutp */ void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); +/** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ +struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); + +/** + * The position within the commitment transactions' outputs. This may be None if the value is + * below the dust limit (in which case no output appears in the commitment transaction and the + * value is spent to additional transaction fees). + */ +void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + +/** + * Constructs a new HTLCOutputInCommitment given each field + */ +MUST_USE_RES struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_new(bool offered_arg, uint64_t amount_msat_arg, uint32_t cltv_expiry_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u32Z transaction_output_index_arg); + /** * Creates a copy of the HTLCOutputInCommitment */ @@ -11026,6 +11113,31 @@ uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR */ void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val); +/** + * The minimum value, in msat, which must be relayed to the next hop. + */ +struct LDKCOption_u64Z RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + +/** + * The minimum value, in msat, which must be relayed to the next hop. + */ +void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + +/** + * The maximum value in msat available for routing with a single HTLC. + */ +struct LDKCOption_u64Z RouteHint_get_htlc_maximum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); + +/** + * The maximum value in msat available for routing with a single HTLC. + */ +void RouteHint_set_htlc_maximum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + +/** + * Constructs a new RouteHint given each field + */ +MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, struct LDKCOption_u64Z htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg); + /** * Creates a copy of the RouteHint */ @@ -11168,6 +11280,16 @@ uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectiona */ void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val); +/** + * The maximum value which may be relayed to the next hop via the channel. + */ +struct LDKCOption_u64Z DirectionalChannelInfo_get_htlc_maximum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); + +/** + * The maximum value which may be relayed to the next hop via the channel. + */ +void DirectionalChannelInfo_set_htlc_maximum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + /** * Fees charged when the channel is used for routing */ @@ -11194,6 +11316,11 @@ struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const str */ void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); +/** + * Constructs a new DirectionalChannelInfo given each field + */ +MUST_USE_RES struct LDKDirectionalChannelInfo DirectionalChannelInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, struct LDKCOption_u64Z htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg); + /** * Creates a copy of the DirectionalChannelInfo */ @@ -11264,6 +11391,16 @@ struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChan */ void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); +/** + * The channel capacity as seen on-chain, if chain lookup is available. + */ +struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr); + +/** + * The channel capacity as seen on-chain, if chain lookup is available. + */ +void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + /** * An initial announcement of the channel * Mostly redundant with the data we store in fields explicitly. @@ -11280,6 +11417,11 @@ struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct */ void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); +/** + * Constructs a new ChannelInfo given each field + */ +MUST_USE_RES struct LDKChannelInfo ChannelInfo_new(struct LDKChannelFeatures features_arg, struct LDKPublicKey node_one_arg, struct LDKDirectionalChannelInfo one_to_two_arg, struct LDKPublicKey node_two_arg, struct LDKDirectionalChannelInfo two_to_one_arg, struct LDKCOption_u64Z capacity_sats_arg, struct LDKChannelAnnouncement announcement_message_arg); + /** * Creates a copy of the ChannelInfo */