X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelConfig.mts;fp=ts%2Fstructs%2FChannelConfig.mts;h=2f651f10426506e2012999c1293f8de49837e279;hb=aeef350521c838e28a782405a1d45b5e2132e194;hp=035f7fb2d2a3229d0dc35a20cd9b260971acc9df;hpb=a81b4baf7d4c8a43a02ff58b00808119f59b1e1b;p=ldk-java diff --git a/ts/structs/ChannelConfig.mts b/ts/structs/ChannelConfig.mts index 035f7fb2..2f651f10 100644 --- a/ts/structs/ChannelConfig.mts +++ b/ts/structs/ChannelConfig.mts @@ -1,7 +1,11 @@ import { TxOut } from '../structs/TxOut.mjs'; +import { TxIn } from '../structs/TxIn.mjs'; import { BigEndianScalar } from '../structs/BigEndianScalar.mjs'; +import { Bolt11SemanticError } from '../enums/Bolt11SemanticError.mjs'; +import { Bolt12SemanticError } from '../enums/Bolt12SemanticError.mjs'; import { COption_NoneZ } from '../enums/COption_NoneZ.mjs'; import { ChannelMonitorUpdateStatus } from '../enums/ChannelMonitorUpdateStatus.mjs'; +import { ChannelShutdownState } from '../enums/ChannelShutdownState.mjs'; import { ConfirmationTarget } from '../enums/ConfirmationTarget.mjs'; import { CreationError } from '../enums/CreationError.mjs'; import { Currency } from '../enums/Currency.mjs'; @@ -14,20 +18,29 @@ import { PaymentFailureReason } from '../enums/PaymentFailureReason.mjs'; import { Recipient } from '../enums/Recipient.mjs'; import { RetryableSendFailure } from '../enums/RetryableSendFailure.mjs'; import { Secp256k1Error } from '../enums/Secp256k1Error.mjs'; -import { SemanticError } from '../enums/SemanticError.mjs'; import { SiPrefix } from '../enums/SiPrefix.mjs'; import { UtxoLookupError } from '../enums/UtxoLookupError.mjs'; import { Bech32Error } from '../structs/Bech32Error.mjs'; import { Option_DurationZ } from '../structs/Option_DurationZ.mjs'; import { BlindedPath } from '../structs/BlindedPath.mjs'; import { Option_u64Z } from '../structs/Option_u64Z.mjs'; +import { Refund } from '../structs/Refund.mjs'; +import { Bolt12ParseError } from '../structs/Bolt12ParseError.mjs'; +import { Result_RefundBolt12ParseErrorZ } from '../structs/Result_RefundBolt12ParseErrorZ.mjs'; import { ShutdownScript } from '../structs/ShutdownScript.mjs'; import { APIError } from '../structs/APIError.mjs'; import { Result_NoneAPIErrorZ } from '../structs/Result_NoneAPIErrorZ.mjs'; +import { Option_PaymentSecretZ } from '../structs/Option_PaymentSecretZ.mjs'; import { Option_CVec_u8ZZ } from '../structs/Option_CVec_u8ZZ.mjs'; import { RecipientOnionFields } from '../structs/RecipientOnionFields.mjs'; import { DecodeError } from '../structs/DecodeError.mjs'; import { Result_RecipientOnionFieldsDecodeErrorZ } from '../structs/Result_RecipientOnionFieldsDecodeErrorZ.mjs'; +import { InvoiceRequest } from '../structs/InvoiceRequest.mjs'; +import { Bolt12Invoice } from '../structs/Bolt12Invoice.mjs'; +import { InvoiceError } from '../structs/InvoiceError.mjs'; +import { OffersMessage } from '../structs/OffersMessage.mjs'; +import { Option_OffersMessageZ } from '../structs/Option_OffersMessageZ.mjs'; +import { Result_OffersMessageDecodeErrorZ } from '../structs/Result_OffersMessageDecodeErrorZ.mjs'; import { Option_HTLCClaimZ } from '../structs/Option_HTLCClaimZ.mjs'; import { Result_NoneNoneZ } from '../structs/Result_NoneNoneZ.mjs'; import { CounterpartyCommitmentSecrets } from '../structs/CounterpartyCommitmentSecrets.mjs'; @@ -39,6 +52,7 @@ import { Result_ChannelPublicKeysDecodeErrorZ } from '../structs/Result_ChannelP import { Option_u32Z } from '../structs/Option_u32Z.mjs'; import { HTLCOutputInCommitment } from '../structs/HTLCOutputInCommitment.mjs'; import { Result_HTLCOutputInCommitmentDecodeErrorZ } from '../structs/Result_HTLCOutputInCommitmentDecodeErrorZ.mjs'; +import { Option_PaymentPreimageZ } from '../structs/Option_PaymentPreimageZ.mjs'; import { CounterpartyChannelTransactionParameters } from '../structs/CounterpartyChannelTransactionParameters.mjs'; import { Result_CounterpartyChannelTransactionParametersDecodeErrorZ } from '../structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.mjs'; import { ChannelTransactionParameters } from '../structs/ChannelTransactionParameters.mjs'; @@ -59,6 +73,37 @@ import { InvalidShutdownScript } from '../structs/InvalidShutdownScript.mjs'; import { Result_ShutdownScriptInvalidShutdownScriptZ } from '../structs/Result_ShutdownScriptInvalidShutdownScriptZ.mjs'; import { BlindedPayInfo } from '../structs/BlindedPayInfo.mjs'; import { Result_BlindedPayInfoDecodeErrorZ } from '../structs/Result_BlindedPayInfoDecodeErrorZ.mjs'; +import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs'; +import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs'; +import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs'; +import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs'; +import { OutPoint } from '../structs/OutPoint.mjs'; +import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs'; +import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs'; +import { Option_PackedLockTimeZ } from '../structs/Option_PackedLockTimeZ.mjs'; +import { TwoTuple_PartiallySignedTransactionusizeZ } from '../structs/TwoTuple_PartiallySignedTransactionusizeZ.mjs'; +import { Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ } from '../structs/Result_C2Tuple_PartiallySignedTransactionusizeZNoneZ.mjs'; +import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs'; +import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs'; +import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs'; +import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs'; +import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs'; +import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs'; +import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs'; +import { HTLCDescriptor } from '../structs/HTLCDescriptor.mjs'; +import { ClosingTransaction } from '../structs/ClosingTransaction.mjs'; +import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs'; +import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs'; +import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs'; +import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs'; +import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs'; +import { Result_ScriptNoneZ } from '../structs/Result_ScriptNoneZ.mjs'; +import { Result_ShutdownScriptNoneZ } from '../structs/Result_ShutdownScriptNoneZ.mjs'; +import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs'; +import { InMemorySigner } from '../structs/InMemorySigner.mjs'; +import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs'; +import { Result_PartiallySignedTransactionNoneZ } from '../structs/Result_PartiallySignedTransactionNoneZ.mjs'; +import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs'; import { ChannelDetails } from '../structs/ChannelDetails.mjs'; import { Route } from '../structs/Route.mjs'; import { LightningError } from '../structs/LightningError.mjs'; @@ -82,19 +127,19 @@ import { RouteHintHop } from '../structs/RouteHintHop.mjs'; import { Result_RouteHintDecodeErrorZ } from '../structs/Result_RouteHintDecodeErrorZ.mjs'; import { Result_RouteHintHopDecodeErrorZ } from '../structs/Result_RouteHintHopDecodeErrorZ.mjs'; import { TwoTuple_usizeTransactionZ } from '../structs/TwoTuple_usizeTransactionZ.mjs'; -import { TwoTuple_TxidBlockHashZ } from '../structs/TwoTuple_TxidBlockHashZ.mjs'; +import { Option_BlockHashZ } from '../structs/Option_BlockHashZ.mjs'; +import { TwoTuple_TxidCOption_BlockHashZZ } from '../structs/TwoTuple_TxidCOption_BlockHashZZ.mjs'; import { HTLCUpdate } from '../structs/HTLCUpdate.mjs'; -import { OutPoint } from '../structs/OutPoint.mjs'; import { MonitorEvent } from '../structs/MonitorEvent.mjs'; import { ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ } from '../structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.mjs'; import { FixedPenaltyScorer } from '../structs/FixedPenaltyScorer.mjs'; import { Result_FixedPenaltyScorerDecodeErrorZ } from '../structs/Result_FixedPenaltyScorerDecodeErrorZ.mjs'; +import { NodeId } from '../structs/NodeId.mjs'; import { TwoTuple_u64u64Z } from '../structs/TwoTuple_u64u64Z.mjs'; import { Option_C2Tuple_u64u64ZZ } from '../structs/Option_C2Tuple_u64u64ZZ.mjs'; import { TwoTuple_Z } from '../structs/TwoTuple_Z.mjs'; import { TwoTuple__u168_u168Z } from '../structs/TwoTuple__u168_u168Z.mjs'; import { Option_C2Tuple_EightU16sEightU16sZZ } from '../structs/Option_C2Tuple_EightU16sEightU16sZZ.mjs'; -import { NodeId } from '../structs/NodeId.mjs'; import { Record } from '../structs/Record.mjs'; import { Logger, LoggerInterface } from '../structs/Logger.mjs'; import { NetworkGraph } from '../structs/NetworkGraph.mjs'; @@ -106,8 +151,10 @@ import { ChannelFeatures } from '../structs/ChannelFeatures.mjs'; import { Result_ChannelFeaturesDecodeErrorZ } from '../structs/Result_ChannelFeaturesDecodeErrorZ.mjs'; import { NodeFeatures } from '../structs/NodeFeatures.mjs'; import { Result_NodeFeaturesDecodeErrorZ } from '../structs/Result_NodeFeaturesDecodeErrorZ.mjs'; -import { InvoiceFeatures } from '../structs/InvoiceFeatures.mjs'; -import { Result_InvoiceFeaturesDecodeErrorZ } from '../structs/Result_InvoiceFeaturesDecodeErrorZ.mjs'; +import { Bolt11InvoiceFeatures } from '../structs/Bolt11InvoiceFeatures.mjs'; +import { Result_Bolt11InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.mjs'; +import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs'; +import { Result_Bolt12InvoiceFeaturesDecodeErrorZ } from '../structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.mjs'; import { BlindedHopFeatures } from '../structs/BlindedHopFeatures.mjs'; import { Result_BlindedHopFeaturesDecodeErrorZ } from '../structs/Result_BlindedHopFeaturesDecodeErrorZ.mjs'; import { ChannelTypeFeatures } from '../structs/ChannelTypeFeatures.mjs'; @@ -129,17 +176,28 @@ import { Option_HTLCDestinationZ } from '../structs/Option_HTLCDestinationZ.mjs' import { Result_COption_HTLCDestinationZDecodeErrorZ } from '../structs/Result_COption_HTLCDestinationZDecodeErrorZ.mjs'; import { Result_PaymentFailureReasonDecodeErrorZ } from '../structs/Result_PaymentFailureReasonDecodeErrorZ.mjs'; import { Option_u128Z } from '../structs/Option_u128Z.mjs'; +import { Option_PaymentIdZ } from '../structs/Option_PaymentIdZ.mjs'; import { Option_PaymentFailureReasonZ } from '../structs/Option_PaymentFailureReasonZ.mjs'; -import { DelayedPaymentOutputDescriptor } from '../structs/DelayedPaymentOutputDescriptor.mjs'; -import { StaticPaymentOutputDescriptor } from '../structs/StaticPaymentOutputDescriptor.mjs'; -import { SpendableOutputDescriptor } from '../structs/SpendableOutputDescriptor.mjs'; +import { Option_PaymentHashZ } from '../structs/Option_PaymentHashZ.mjs'; +import { AnchorDescriptor } from '../structs/AnchorDescriptor.mjs'; +import { BumpTransactionEvent } from '../structs/BumpTransactionEvent.mjs'; import { Event } from '../structs/Event.mjs'; import { Option_EventZ } from '../structs/Option_EventZ.mjs'; import { Result_COption_EventZDecodeErrorZ } from '../structs/Result_COption_EventZDecodeErrorZ.mjs'; import { AcceptChannel } from '../structs/AcceptChannel.mjs'; +import { AcceptChannelV2 } from '../structs/AcceptChannelV2.mjs'; import { OpenChannel } from '../structs/OpenChannel.mjs'; +import { OpenChannelV2 } from '../structs/OpenChannelV2.mjs'; import { FundingCreated } from '../structs/FundingCreated.mjs'; import { FundingSigned } from '../structs/FundingSigned.mjs'; +import { TxAddInput } from '../structs/TxAddInput.mjs'; +import { TxAddOutput } from '../structs/TxAddOutput.mjs'; +import { TxRemoveInput } from '../structs/TxRemoveInput.mjs'; +import { TxRemoveOutput } from '../structs/TxRemoveOutput.mjs'; +import { TxComplete } from '../structs/TxComplete.mjs'; +import { TxSignatures } from '../structs/TxSignatures.mjs'; +import { TxInitRbf } from '../structs/TxInitRbf.mjs'; +import { TxAckRbf } from '../structs/TxAckRbf.mjs'; import { ChannelReady } from '../structs/ChannelReady.mjs'; import { AnnouncementSignatures } from '../structs/AnnouncementSignatures.mjs'; import { CommitmentUpdate } from '../structs/CommitmentUpdate.mjs'; @@ -157,6 +215,8 @@ import { QueryShortChannelIds } from '../structs/QueryShortChannelIds.mjs'; import { ReplyChannelRange } from '../structs/ReplyChannelRange.mjs'; import { GossipTimestampFilter } from '../structs/GossipTimestampFilter.mjs'; import { MessageSendEvent } from '../structs/MessageSendEvent.mjs'; +import { Offer } from '../structs/Offer.mjs'; +import { Result_OfferBolt12ParseErrorZ } from '../structs/Result_OfferBolt12ParseErrorZ.mjs'; import { Result_PublicKeyErrorZ } from '../structs/Result_PublicKeyErrorZ.mjs'; import { Result_NodeIdDecodeErrorZ } from '../structs/Result_NodeIdDecodeErrorZ.mjs'; import { Result_COption_NetworkUpdateZDecodeErrorZ } from '../structs/Result_COption_NetworkUpdateZDecodeErrorZ.mjs'; @@ -165,10 +225,10 @@ import { UtxoFuture } from '../structs/UtxoFuture.mjs'; import { UtxoResult } from '../structs/UtxoResult.mjs'; import { UtxoLookup, UtxoLookupInterface } from '../structs/UtxoLookup.mjs'; import { Option_UtxoLookupZ } from '../structs/Option_UtxoLookupZ.mjs'; +import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs'; import { Result_boolLightningErrorZ } from '../structs/Result_boolLightningErrorZ.mjs'; import { ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ } from '../structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.mjs'; import { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ } from '../structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.mjs'; -import { Result_NoneLightningErrorZ } from '../structs/Result_NoneLightningErrorZ.mjs'; import { ChannelUpdateInfo } from '../structs/ChannelUpdateInfo.mjs'; import { Result_ChannelUpdateInfoDecodeErrorZ } from '../structs/Result_ChannelUpdateInfoDecodeErrorZ.mjs'; import { ChannelInfo } from '../structs/ChannelInfo.mjs'; @@ -185,27 +245,14 @@ import { NodeInfo } from '../structs/NodeInfo.mjs'; import { Result_NodeInfoDecodeErrorZ } from '../structs/Result_NodeInfoDecodeErrorZ.mjs'; import { Result_NetworkGraphDecodeErrorZ } from '../structs/Result_NetworkGraphDecodeErrorZ.mjs'; import { Option_CVec_NetAddressZZ } from '../structs/Option_CVec_NetAddressZZ.mjs'; -import { Result_DelayedPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.mjs'; -import { Result_StaticPaymentOutputDescriptorDecodeErrorZ } from '../structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.mjs'; -import { Result_SpendableOutputDescriptorDecodeErrorZ } from '../structs/Result_SpendableOutputDescriptorDecodeErrorZ.mjs'; -import { TwoTuple_SignatureCVec_SignatureZZ } from '../structs/TwoTuple_SignatureCVec_SignatureZZ.mjs'; -import { Result_C2Tuple_SignatureCVec_SignatureZZNoneZ } from '../structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.mjs'; -import { Result_SignatureNoneZ } from '../structs/Result_SignatureNoneZ.mjs'; -import { Result_PublicKeyNoneZ } from '../structs/Result_PublicKeyNoneZ.mjs'; -import { Option_ScalarZ } from '../structs/Option_ScalarZ.mjs'; -import { Result_SharedSecretNoneZ } from '../structs/Result_SharedSecretNoneZ.mjs'; -import { Result_RecoverableSignatureNoneZ } from '../structs/Result_RecoverableSignatureNoneZ.mjs'; -import { ClosingTransaction } from '../structs/ClosingTransaction.mjs'; -import { UnsignedChannelAnnouncement } from '../structs/UnsignedChannelAnnouncement.mjs'; -import { ChannelSigner, ChannelSignerInterface } from '../structs/ChannelSigner.mjs'; -import { EcdsaChannelSigner, EcdsaChannelSignerInterface } from '../structs/EcdsaChannelSigner.mjs'; -import { WriteableEcdsaChannelSigner, WriteableEcdsaChannelSignerInterface } from '../structs/WriteableEcdsaChannelSigner.mjs'; -import { Result_WriteableEcdsaChannelSignerDecodeErrorZ } from '../structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.mjs'; -import { Result_CVec_CVec_u8ZZNoneZ } from '../structs/Result_CVec_CVec_u8ZZNoneZ.mjs'; -import { InMemorySigner } from '../structs/InMemorySigner.mjs'; -import { Result_InMemorySignerDecodeErrorZ } from '../structs/Result_InMemorySignerDecodeErrorZ.mjs'; -import { Result_TransactionNoneZ } from '../structs/Result_TransactionNoneZ.mjs'; +import { Utxo } from '../structs/Utxo.mjs'; +import { Option_TxOutZ } from '../structs/Option_TxOutZ.mjs'; +import { Input } from '../structs/Input.mjs'; +import { CoinSelection } from '../structs/CoinSelection.mjs'; +import { Result_CoinSelectionNoneZ } from '../structs/Result_CoinSelectionNoneZ.mjs'; +import { Result_CVec_UtxoZNoneZ } from '../structs/Result_CVec_UtxoZNoneZ.mjs'; import { Option_u16Z } from '../structs/Option_u16Z.mjs'; +import { Option_ChannelShutdownStateZ } from '../structs/Option_ChannelShutdownStateZ.mjs'; import { Result__u832APIErrorZ } from '../structs/Result__u832APIErrorZ.mjs'; import { RecentPaymentDetails } from '../structs/RecentPaymentDetails.mjs'; import { PaymentSendFailure } from '../structs/PaymentSendFailure.mjs'; @@ -217,10 +264,9 @@ import { TwoTuple_PaymentHashPaymentIdZ } from '../structs/TwoTuple_PaymentHashP import { Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ } from '../structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.mjs'; import { TwoTuple_PaymentHashPaymentSecretZ } from '../structs/TwoTuple_PaymentHashPaymentSecretZ.mjs'; import { Result_C2Tuple_PaymentHashPaymentSecretZNoneZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.mjs'; -import { Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ } from '../structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.mjs'; import { Result_PaymentSecretNoneZ } from '../structs/Result_PaymentSecretNoneZ.mjs'; -import { Result_PaymentSecretAPIErrorZ } from '../structs/Result_PaymentSecretAPIErrorZ.mjs'; import { Result_PaymentPreimageAPIErrorZ } from '../structs/Result_PaymentPreimageAPIErrorZ.mjs'; +import { Option_CVec_ChainHashZZ } from '../structs/Option_CVec_ChainHashZZ.mjs'; import { CounterpartyForwardingInfo } from '../structs/CounterpartyForwardingInfo.mjs'; import { Result_CounterpartyForwardingInfoDecodeErrorZ } from '../structs/Result_CounterpartyForwardingInfoDecodeErrorZ.mjs'; import { ChannelCounterparty } from '../structs/ChannelCounterparty.mjs'; @@ -228,6 +274,7 @@ import { Result_ChannelCounterpartyDecodeErrorZ } from '../structs/Result_Channe import { Result_ChannelDetailsDecodeErrorZ } from '../structs/Result_ChannelDetailsDecodeErrorZ.mjs'; import { PhantomRouteHints } from '../structs/PhantomRouteHints.mjs'; import { Result_PhantomRouteHintsDecodeErrorZ } from '../structs/Result_PhantomRouteHintsDecodeErrorZ.mjs'; +import { Result_ChannelShutdownStateDecodeErrorZ } from '../structs/Result_ChannelShutdownStateDecodeErrorZ.mjs'; import { ChannelMonitor } from '../structs/ChannelMonitor.mjs'; import { ChannelMonitorUpdate } from '../structs/ChannelMonitorUpdate.mjs'; import { Watch, WatchInterface } from '../structs/Watch.mjs'; @@ -243,9 +290,18 @@ import { Router, RouterInterface } from '../structs/Router.mjs'; import { ChannelManager } from '../structs/ChannelManager.mjs'; import { TwoTuple_BlockHashChannelManagerZ } from '../structs/TwoTuple_BlockHashChannelManagerZ.mjs'; import { Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ } from '../structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.mjs'; +import { MaxDustHTLCExposure } from '../structs/MaxDustHTLCExposure.mjs'; +import { Result_MaxDustHTLCExposureDecodeErrorZ } from '../structs/Result_MaxDustHTLCExposureDecodeErrorZ.mjs'; import { Result_ChannelConfigDecodeErrorZ } from '../structs/Result_ChannelConfigDecodeErrorZ.mjs'; +import { Option_MaxDustHTLCExposureZ } from '../structs/Option_MaxDustHTLCExposureZ.mjs'; import { Option_APIErrorZ } from '../structs/Option_APIErrorZ.mjs'; import { Result_COption_APIErrorZDecodeErrorZ } from '../structs/Result_COption_APIErrorZDecodeErrorZ.mjs'; +import { BigSize } from '../structs/BigSize.mjs'; +import { Result_BigSizeDecodeErrorZ } from '../structs/Result_BigSizeDecodeErrorZ.mjs'; +import { Result_HostnameDecodeErrorZ } from '../structs/Result_HostnameDecodeErrorZ.mjs'; +import { TransactionU16LenLimited } from '../structs/TransactionU16LenLimited.mjs'; +import { Result_TransactionU16LenLimitedNoneZ } from '../structs/Result_TransactionU16LenLimitedNoneZ.mjs'; +import { Result_TransactionU16LenLimitedDecodeErrorZ } from '../structs/Result_TransactionU16LenLimitedDecodeErrorZ.mjs'; import { Result_UntrustedStringDecodeErrorZ } from '../structs/Result_UntrustedStringDecodeErrorZ.mjs'; import { Result_OutPointDecodeErrorZ } from '../structs/Result_OutPointDecodeErrorZ.mjs'; import { Type, TypeInterface } from '../structs/Type.mjs'; @@ -277,6 +333,8 @@ import { PeerHandleError } from '../structs/PeerHandleError.mjs'; import { Result_CVec_u8ZPeerHandleErrorZ } from '../structs/Result_CVec_u8ZPeerHandleErrorZ.mjs'; import { Result_NonePeerHandleErrorZ } from '../structs/Result_NonePeerHandleErrorZ.mjs'; import { Result_boolPeerHandleErrorZ } from '../structs/Result_boolPeerHandleErrorZ.mjs'; +import { OnionMessagePath } from '../structs/OnionMessagePath.mjs'; +import { Result_OnionMessagePathNoneZ } from '../structs/Result_OnionMessagePathNoneZ.mjs'; import { SendError } from '../structs/SendError.mjs'; import { Result_NoneSendErrorZ } from '../structs/Result_NoneSendErrorZ.mjs'; import { Result_BlindedPathNoneZ } from '../structs/Result_BlindedPathNoneZ.mjs'; @@ -285,12 +343,26 @@ import { Result_BlindedHopDecodeErrorZ } from '../structs/Result_BlindedHopDecod import { GraphSyncError } from '../structs/GraphSyncError.mjs'; import { Result_u32GraphSyncErrorZ } from '../structs/Result_u32GraphSyncErrorZ.mjs'; import { Result_NoneErrorZ } from '../structs/Result_NoneErrorZ.mjs'; +import { Option_ScriptZ } from '../structs/Option_ScriptZ.mjs'; +import { Option_i64Z } from '../structs/Option_i64Z.mjs'; +import { Option_TxidZ } from '../structs/Option_TxidZ.mjs'; import { Result_NetAddressDecodeErrorZ } from '../structs/Result_NetAddressDecodeErrorZ.mjs'; import { UpdateAddHTLC } from '../structs/UpdateAddHTLC.mjs'; import { UpdateFulfillHTLC } from '../structs/UpdateFulfillHTLC.mjs'; import { UpdateFailHTLC } from '../structs/UpdateFailHTLC.mjs'; import { UpdateFailMalformedHTLC } from '../structs/UpdateFailMalformedHTLC.mjs'; import { Result_AcceptChannelDecodeErrorZ } from '../structs/Result_AcceptChannelDecodeErrorZ.mjs'; +import { Result_AcceptChannelV2DecodeErrorZ } from '../structs/Result_AcceptChannelV2DecodeErrorZ.mjs'; +import { Result_TxAddInputDecodeErrorZ } from '../structs/Result_TxAddInputDecodeErrorZ.mjs'; +import { Result_TxAddOutputDecodeErrorZ } from '../structs/Result_TxAddOutputDecodeErrorZ.mjs'; +import { Result_TxRemoveInputDecodeErrorZ } from '../structs/Result_TxRemoveInputDecodeErrorZ.mjs'; +import { Result_TxRemoveOutputDecodeErrorZ } from '../structs/Result_TxRemoveOutputDecodeErrorZ.mjs'; +import { Result_TxCompleteDecodeErrorZ } from '../structs/Result_TxCompleteDecodeErrorZ.mjs'; +import { Result_TxSignaturesDecodeErrorZ } from '../structs/Result_TxSignaturesDecodeErrorZ.mjs'; +import { Result_TxInitRbfDecodeErrorZ } from '../structs/Result_TxInitRbfDecodeErrorZ.mjs'; +import { Result_TxAckRbfDecodeErrorZ } from '../structs/Result_TxAckRbfDecodeErrorZ.mjs'; +import { TxAbort } from '../structs/TxAbort.mjs'; +import { Result_TxAbortDecodeErrorZ } from '../structs/Result_TxAbortDecodeErrorZ.mjs'; import { Result_AnnouncementSignaturesDecodeErrorZ } from '../structs/Result_AnnouncementSignaturesDecodeErrorZ.mjs'; import { Result_ChannelReestablishDecodeErrorZ } from '../structs/Result_ChannelReestablishDecodeErrorZ.mjs'; import { Result_ClosingSignedDecodeErrorZ } from '../structs/Result_ClosingSignedDecodeErrorZ.mjs'; @@ -304,6 +376,7 @@ import { Result_ChannelReadyDecodeErrorZ } from '../structs/Result_ChannelReadyD import { Init } from '../structs/Init.mjs'; import { Result_InitDecodeErrorZ } from '../structs/Result_InitDecodeErrorZ.mjs'; import { Result_OpenChannelDecodeErrorZ } from '../structs/Result_OpenChannelDecodeErrorZ.mjs'; +import { Result_OpenChannelV2DecodeErrorZ } from '../structs/Result_OpenChannelV2DecodeErrorZ.mjs'; import { Result_RevokeAndACKDecodeErrorZ } from '../structs/Result_RevokeAndACKDecodeErrorZ.mjs'; import { Result_ShutdownDecodeErrorZ } from '../structs/Result_ShutdownDecodeErrorZ.mjs'; import { Result_UpdateFailHTLCDecodeErrorZ } from '../structs/Result_UpdateFailHTLCDecodeErrorZ.mjs'; @@ -332,6 +405,9 @@ import { Result_ReplyShortChannelIdsEndDecodeErrorZ } from '../structs/Result_Re import { Result_QueryChannelRangeDecodeErrorZ } from '../structs/Result_QueryChannelRangeDecodeErrorZ.mjs'; import { Result_ReplyChannelRangeDecodeErrorZ } from '../structs/Result_ReplyChannelRangeDecodeErrorZ.mjs'; import { Result_GossipTimestampFilterDecodeErrorZ } from '../structs/Result_GossipTimestampFilterDecodeErrorZ.mjs'; +import { Option_KeyPairZ } from '../structs/Option_KeyPairZ.mjs'; +import { Result_COption_KeyPairZNoneZ } from '../structs/Result_COption_KeyPairZNoneZ.mjs'; +import { Result_InvoiceErrorDecodeErrorZ } from '../structs/Result_InvoiceErrorDecodeErrorZ.mjs'; import { WatchedOutput } from '../structs/WatchedOutput.mjs'; import { Filter, FilterInterface } from '../structs/Filter.mjs'; import { Option_FilterZ } from '../structs/Option_FilterZ.mjs'; @@ -339,30 +415,30 @@ import { LockedChannelMonitor } from '../structs/LockedChannelMonitor.mjs'; import { Result_LockedChannelMonitorNoneZ } from '../structs/Result_LockedChannelMonitorNoneZ.mjs'; import { MonitorUpdateId } from '../structs/MonitorUpdateId.mjs'; import { TwoTuple_OutPointCVec_MonitorUpdateIdZZ } from '../structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.mjs'; -import { Invoice } from '../structs/Invoice.mjs'; +import { Bolt11Invoice } from '../structs/Bolt11Invoice.mjs'; import { SignOrCreationError } from '../structs/SignOrCreationError.mjs'; -import { Result_InvoiceSignOrCreationErrorZ } from '../structs/Result_InvoiceSignOrCreationErrorZ.mjs'; -import { ParseError } from '../structs/ParseError.mjs'; -import { Result_SiPrefixParseErrorZ } from '../structs/Result_SiPrefixParseErrorZ.mjs'; +import { Result_Bolt11InvoiceSignOrCreationErrorZ } from '../structs/Result_Bolt11InvoiceSignOrCreationErrorZ.mjs'; +import { Bolt11ParseError } from '../structs/Bolt11ParseError.mjs'; +import { Result_SiPrefixBolt11ParseErrorZ } from '../structs/Result_SiPrefixBolt11ParseErrorZ.mjs'; import { ParseOrSemanticError } from '../structs/ParseOrSemanticError.mjs'; -import { Result_InvoiceParseOrSemanticErrorZ } from '../structs/Result_InvoiceParseOrSemanticErrorZ.mjs'; -import { SignedRawInvoice } from '../structs/SignedRawInvoice.mjs'; -import { Result_SignedRawInvoiceParseErrorZ } from '../structs/Result_SignedRawInvoiceParseErrorZ.mjs'; -import { RawInvoice } from '../structs/RawInvoice.mjs'; -import { InvoiceSignature } from '../structs/InvoiceSignature.mjs'; -import { ThreeTuple_RawInvoice_u832InvoiceSignatureZ } from '../structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.mjs'; +import { Result_Bolt11InvoiceParseOrSemanticErrorZ } from '../structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.mjs'; +import { SignedRawBolt11Invoice } from '../structs/SignedRawBolt11Invoice.mjs'; +import { Result_SignedRawBolt11InvoiceBolt11ParseErrorZ } from '../structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.mjs'; +import { RawBolt11Invoice } from '../structs/RawBolt11Invoice.mjs'; +import { Bolt11InvoiceSignature } from '../structs/Bolt11InvoiceSignature.mjs'; +import { ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ } from '../structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.mjs'; import { PayeePubKey } from '../structs/PayeePubKey.mjs'; import { Result_PayeePubKeyErrorZ } from '../structs/Result_PayeePubKeyErrorZ.mjs'; import { PrivateRoute } from '../structs/PrivateRoute.mjs'; import { PositiveTimestamp } from '../structs/PositiveTimestamp.mjs'; import { Result_PositiveTimestampCreationErrorZ } from '../structs/Result_PositiveTimestampCreationErrorZ.mjs'; -import { Result_NoneSemanticErrorZ } from '../structs/Result_NoneSemanticErrorZ.mjs'; -import { Result_InvoiceSemanticErrorZ } from '../structs/Result_InvoiceSemanticErrorZ.mjs'; +import { Result_NoneBolt11SemanticErrorZ } from '../structs/Result_NoneBolt11SemanticErrorZ.mjs'; +import { Result_Bolt11InvoiceBolt11SemanticErrorZ } from '../structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.mjs'; import { Description } from '../structs/Description.mjs'; import { Result_DescriptionCreationErrorZ } from '../structs/Result_DescriptionCreationErrorZ.mjs'; import { Result_PrivateRouteCreationErrorZ } from '../structs/Result_PrivateRouteCreationErrorZ.mjs'; -import { BigSize } from '../structs/BigSize.mjs'; import { ChannelUsage } from '../structs/ChannelUsage.mjs'; +import { ProbabilisticScoringFeeParameters } from '../structs/ProbabilisticScoringFeeParameters.mjs'; import { Score, ScoreInterface } from '../structs/Score.mjs'; import { LockableScore, LockableScoreInterface } from '../structs/LockableScore.mjs'; import { WriteableScore, WriteableScoreInterface } from '../structs/WriteableScore.mjs'; @@ -372,6 +448,7 @@ import { FutureCallback, FutureCallbackInterface } from '../structs/FutureCallba import { Future } from '../structs/Future.mjs'; import { ChannelHandshakeConfig } from '../structs/ChannelHandshakeConfig.mjs'; import { ChannelHandshakeLimits } from '../structs/ChannelHandshakeLimits.mjs'; +import { ChannelConfigUpdate } from '../structs/ChannelConfigUpdate.mjs'; import { UserConfig } from '../structs/UserConfig.mjs'; import { BestBlock } from '../structs/BestBlock.mjs'; import { Listen, ListenInterface } from '../structs/Listen.mjs'; @@ -380,21 +457,19 @@ import { Persist, PersistInterface } from '../structs/Persist.mjs'; import { ChainMonitor } from '../structs/ChainMonitor.mjs'; import { EventHandler, EventHandlerInterface } from '../structs/EventHandler.mjs'; import { EventsProvider, EventsProviderInterface } from '../structs/EventsProvider.mjs'; -import { KeysManager } from '../structs/KeysManager.mjs'; -import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs'; import { ChainParameters } from '../structs/ChainParameters.mjs'; import { Retry } from '../structs/Retry.mjs'; import { MessageSendEventsProvider, MessageSendEventsProviderInterface } from '../structs/MessageSendEventsProvider.mjs'; import { ChannelMessageHandler, ChannelMessageHandlerInterface } from '../structs/ChannelMessageHandler.mjs'; import { ChannelManagerReadArgs } from '../structs/ChannelManagerReadArgs.mjs'; import { ExpandedKey } from '../structs/ExpandedKey.mjs'; -import { DataLossProtect } from '../structs/DataLossProtect.mjs'; import { RoutingMessageHandler, RoutingMessageHandlerInterface } from '../structs/RoutingMessageHandler.mjs'; import { OnionMessageProvider, OnionMessageProviderInterface } from '../structs/OnionMessageProvider.mjs'; import { OnionMessageHandler, OnionMessageHandlerInterface } from '../structs/OnionMessageHandler.mjs'; import { CustomMessageReader, CustomMessageReaderInterface } from '../structs/CustomMessageReader.mjs'; import { CustomMessageHandler, CustomMessageHandlerInterface } from '../structs/CustomMessageHandler.mjs'; import { IgnoringMessageHandler } from '../structs/IgnoringMessageHandler.mjs'; +import { OffersMessageHandler, OffersMessageHandlerInterface } from '../structs/OffersMessageHandler.mjs'; import { CustomOnionMessageHandler, CustomOnionMessageHandlerInterface } from '../structs/CustomOnionMessageHandler.mjs'; import { ErroringMessageHandler } from '../structs/ErroringMessageHandler.mjs'; import { MessageHandler } from '../structs/MessageHandler.mjs'; @@ -403,27 +478,33 @@ import { PeerManager } from '../structs/PeerManager.mjs'; import { DirectedChannelTransactionParameters } from '../structs/DirectedChannelTransactionParameters.mjs'; import { OfferFeatures } from '../structs/OfferFeatures.mjs'; import { InvoiceRequestFeatures } from '../structs/InvoiceRequestFeatures.mjs'; -import { Bolt12InvoiceFeatures } from '../structs/Bolt12InvoiceFeatures.mjs'; -import { UnsignedInvoice } from '../structs/UnsignedInvoice.mjs'; +import { UnsignedBolt12Invoice } from '../structs/UnsignedBolt12Invoice.mjs'; +import { ErroneousField } from '../structs/ErroneousField.mjs'; import { UnsignedInvoiceRequest } from '../structs/UnsignedInvoiceRequest.mjs'; -import { InvoiceRequest } from '../structs/InvoiceRequest.mjs'; -import { Offer } from '../structs/Offer.mjs'; import { Amount } from '../structs/Amount.mjs'; import { Quantity } from '../structs/Quantity.mjs'; -import { Refund } from '../structs/Refund.mjs'; import { P2PGossipSync } from '../structs/P2PGossipSync.mjs'; import { ReadOnlyNetworkGraph } from '../structs/ReadOnlyNetworkGraph.mjs'; import { DirectedChannelInfo } from '../structs/DirectedChannelInfo.mjs'; import { EffectiveCapacity } from '../structs/EffectiveCapacity.mjs'; import { DefaultRouter } from '../structs/DefaultRouter.mjs'; import { ScorerAccountingForInFlightHtlcs } from '../structs/ScorerAccountingForInFlightHtlcs.mjs'; -import { Hints } from '../structs/Hints.mjs'; +import { Payee } from '../structs/Payee.mjs'; import { MultiThreadedLockableScore } from '../structs/MultiThreadedLockableScore.mjs'; import { MultiThreadedScoreLock } from '../structs/MultiThreadedScoreLock.mjs'; -import { ProbabilisticScoringParameters } from '../structs/ProbabilisticScoringParameters.mjs'; -import { OnionMessenger } from '../structs/OnionMessenger.mjs'; +import { ProbabilisticScoringDecayParameters } from '../structs/ProbabilisticScoringDecayParameters.mjs'; +import { KeysManager } from '../structs/KeysManager.mjs'; +import { PhantomKeysManager } from '../structs/PhantomKeysManager.mjs'; import { Destination } from '../structs/Destination.mjs'; +import { MessageRouter, MessageRouterInterface } from '../structs/MessageRouter.mjs'; +import { OnionMessenger } from '../structs/OnionMessenger.mjs'; +import { DefaultMessageRouter } from '../structs/DefaultMessageRouter.mjs'; import { OnionMessageContents } from '../structs/OnionMessageContents.mjs'; +import { ChannelDerivationParameters } from '../structs/ChannelDerivationParameters.mjs'; +import { CoinSelectionSource, CoinSelectionSourceInterface } from '../structs/CoinSelectionSource.mjs'; +import { WalletSource, WalletSourceInterface } from '../structs/WalletSource.mjs'; +import { Wallet } from '../structs/Wallet.mjs'; +import { BumpTransactionEventHandler } from '../structs/BumpTransactionEventHandler.mjs'; import { RapidGossipSync } from '../structs/RapidGossipSync.mjs'; import { GossipSync } from '../structs/GossipSync.mjs'; import { RawDataPart } from '../structs/RawDataPart.mjs'; @@ -573,18 +654,20 @@ export class ChannelConfig extends CommonBase { * channel negotiated throughout the channel open process, along with the fees required to have * a broadcastable HTLC spending transaction. When a channel supports anchor outputs * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into - * account the HTLC transaction fee as it is zero. + * account the HTLC transaction fee as it is zero. Because of this, you may want to set this + * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier + * variant is primarily intended for use with pre-anchor channels. * - * This limit is applied for sent, forwarded, and received HTLCs and limits the total - * exposure across all three types per-channel. Setting this too low may prevent the - * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very - * important to prevent stealing of dust HTLCs by miners. + * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. * - * Default value: 5_000_000 msat. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. */ - public get_max_dust_htlc_exposure_msat(): bigint { - const ret: bigint = bindings.ChannelConfig_get_max_dust_htlc_exposure_msat(this.ptr); - return ret; + public get_max_dust_htlc_exposure(): MaxDustHTLCExposure { + const ret: bigint = bindings.ChannelConfig_get_max_dust_htlc_exposure(this.ptr); + const ret_hu_conv: MaxDustHTLCExposure = MaxDustHTLCExposure.constr_from_ptr(ret); + CommonBase.add_ref_from(ret_hu_conv, this); + return ret_hu_conv; } /** @@ -601,17 +684,18 @@ export class ChannelConfig extends CommonBase { * channel negotiated throughout the channel open process, along with the fees required to have * a broadcastable HTLC spending transaction. When a channel supports anchor outputs * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into - * account the HTLC transaction fee as it is zero. + * account the HTLC transaction fee as it is zero. Because of this, you may want to set this + * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier + * variant is primarily intended for use with pre-anchor channels. * - * This limit is applied for sent, forwarded, and received HTLCs and limits the total - * exposure across all three types per-channel. Setting this too low may prevent the - * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very - * important to prevent stealing of dust HTLCs by miners. + * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total + * exposure across all three types per-channel. * - * Default value: 5_000_000 msat. + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. */ - public set_max_dust_htlc_exposure_msat(val: bigint): void { - bindings.ChannelConfig_set_max_dust_htlc_exposure_msat(this.ptr, val); + public set_max_dust_htlc_exposure(val: MaxDustHTLCExposure): void { + bindings.ChannelConfig_set_max_dust_htlc_exposure(this.ptr, CommonBase.get_ptr_of(val)); + CommonBase.add_ref_from(this, val); } /** @@ -671,13 +755,85 @@ export class ChannelConfig extends CommonBase { bindings.ChannelConfig_set_force_close_avoidance_max_fee_satoshis(this.ptr, val); } + /** + * If set, allows this channel's counterparty to skim an additional fee off this node's inbound + * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + * + * Usage: + * - The payee will set this option and set its invoice route hints to use [intercept scids] + * generated by this channel's counterparty. + * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call + * [`forward_intercepted_htlc`] with less than the amount provided in + * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and + * actual forward amounts is their fee. + * + * # Note + * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is + * as-expected if this feature is activated, otherwise they may lose money! + * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the + * counterparty. + * + * # Note + * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. + * Unsetting this flag between restarts may lead to payment receive failures. + * + * Default value: false. + * + * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc + * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted + * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat + * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat + */ + public get_accept_underpaying_htlcs(): boolean { + const ret: boolean = bindings.ChannelConfig_get_accept_underpaying_htlcs(this.ptr); + return ret; + } + + /** + * If set, allows this channel's counterparty to skim an additional fee off this node's inbound + * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + * + * Usage: + * - The payee will set this option and set its invoice route hints to use [intercept scids] + * generated by this channel's counterparty. + * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call + * [`forward_intercepted_htlc`] with less than the amount provided in + * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and + * actual forward amounts is their fee. + * + * # Note + * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is + * as-expected if this feature is activated, otherwise they may lose money! + * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the + * counterparty. + * + * # Note + * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116. + * Unsetting this flag between restarts may lead to payment receive failures. + * + * Default value: false. + * + * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc + * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted + * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat + * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat + */ + public set_accept_underpaying_htlcs(val: boolean): void { + bindings.ChannelConfig_set_accept_underpaying_htlcs(this.ptr, val); + } + /** * Constructs a new ChannelConfig given each field */ - public static constructor_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, max_dust_htlc_exposure_msat_arg: bigint, force_close_avoidance_max_fee_satoshis_arg: bigint): ChannelConfig { - const ret: bigint = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_msat_arg, force_close_avoidance_max_fee_satoshis_arg); + public static constructor_new(forwarding_fee_proportional_millionths_arg: number, forwarding_fee_base_msat_arg: number, cltv_expiry_delta_arg: number, max_dust_htlc_exposure_arg: MaxDustHTLCExposure, force_close_avoidance_max_fee_satoshis_arg: bigint, accept_underpaying_htlcs_arg: boolean): ChannelConfig { + const ret: bigint = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, CommonBase.get_ptr_of(max_dust_htlc_exposure_arg), force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); CommonBase.add_ref_from(ret_hu_conv, ret_hu_conv); + CommonBase.add_ref_from(ret_hu_conv, max_dust_htlc_exposure_arg); return ret_hu_conv; } @@ -707,6 +863,14 @@ export class ChannelConfig extends CommonBase { return ret; } + /** + * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`]. + */ + public apply(update: ChannelConfigUpdate): void { + bindings.ChannelConfig_apply(this.ptr, update == null ? 0n : CommonBase.get_ptr_of(update)); + CommonBase.add_ref_from(this, update); + } + /** * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used. */