Package org.ldk.structs
Class OpenChannelV2
- java.lang.Object
-
- org.ldk.structs.OpenChannelV2
-
public class OpenChannelV2 extends Object
An open_channel2 message to be sent by or received from the channel initiator. Used in V2 channel establishment
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OpenChannelV2clone()Creates a copy of the OpenChannelV2booleaneq(OpenChannelV2 b)Checks if two OpenChannelV2s contain equal inner contents.booleanequals(Object o)protected voidfinalize()byte[]get_chain_hash()The genesis hash of the blockchain where the channel is to be openedbyteget_channel_flags()Channel flagsChannelTypeFeaturesget_channel_type()The channel type that this channel will represent.intget_commitment_feerate_sat_per_1000_weight()The feerate for the commitment transaction set by the channel initiatorbyte[]get_delayed_payment_basepoint()Used to derive a payment key to channel initiator for transactions broadcast by channel initiatorlongget_dust_limit_satoshis()The threshold below which outputs on transactions broadcast by the channel initiator will be omittedbyte[]get_first_per_commitment_point()The first to-be-broadcast-by-channel-initiator transaction's per commitment pointintget_funding_feerate_sat_per_1000_weight()The feerate for the funding transaction set by the channel initiatorbyte[]get_funding_pubkey()The channel initiator's key controlling the funding transactionlongget_funding_satoshis()Part of the channel value contributed by the channel initiatorbyte[]get_htlc_basepoint()Used to derive an HTLC payment key to channel initiatorlongget_htlc_minimum_msat()The minimum HTLC size incoming to channel initiator, in milli-satoshiintget_locktime()The locktime for the funding transactionshortget_max_accepted_htlcs()The maximum number of inbound HTLCs towards channel initiatorlongget_max_htlc_value_in_flight_msat()The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshibyte[]get_payment_basepoint()A payment key to channel initiator for transactions broadcast by counterpartyCOption_NoneZget_require_confirmed_inputs()Optionally, a requirement that only confirmed inputs can be addedbyte[]get_revocation_basepoint()Used to derive a revocation key for transactions broadcast by counterpartybyte[]get_second_per_commitment_point()The second to-be-broadcast-by-channel-initiator transaction's per commitment pointOption_CVec_u8ZZget_shutdown_scriptpubkey()Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we collaboratively closebyte[]get_temporary_channel_id()A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepointshortget_to_self_delay()The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transactionstatic OpenChannelV2of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, int funding_feerate_sat_per_1000_weight_arg, int commitment_feerate_sat_per_1000_weight_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, int locktime_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, byte channel_flags_arg, Option_CVec_u8ZZ shutdown_scriptpubkey_arg, ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg)Constructs a new OpenChannelV2 given each field Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent Nonestatic Result_OpenChannelV2DecodeErrorZread(byte[] ser)Read a OpenChannelV2 from a byte array, created by OpenChannelV2_writevoidset_chain_hash(byte[] val)The genesis hash of the blockchain where the channel is to be openedvoidset_channel_flags(byte val)Channel flagsvoidset_channel_type(ChannelTypeFeatures val)The channel type that this channel will represent.voidset_commitment_feerate_sat_per_1000_weight(int val)The feerate for the commitment transaction set by the channel initiatorvoidset_delayed_payment_basepoint(byte[] val)Used to derive a payment key to channel initiator for transactions broadcast by channel initiatorvoidset_dust_limit_satoshis(long val)The threshold below which outputs on transactions broadcast by the channel initiator will be omittedvoidset_first_per_commitment_point(byte[] val)The first to-be-broadcast-by-channel-initiator transaction's per commitment pointvoidset_funding_feerate_sat_per_1000_weight(int val)The feerate for the funding transaction set by the channel initiatorvoidset_funding_pubkey(byte[] val)The channel initiator's key controlling the funding transactionvoidset_funding_satoshis(long val)Part of the channel value contributed by the channel initiatorvoidset_htlc_basepoint(byte[] val)Used to derive an HTLC payment key to channel initiatorvoidset_htlc_minimum_msat(long val)The minimum HTLC size incoming to channel initiator, in milli-satoshivoidset_locktime(int val)The locktime for the funding transactionvoidset_max_accepted_htlcs(short val)The maximum number of inbound HTLCs towards channel initiatorvoidset_max_htlc_value_in_flight_msat(long val)The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshivoidset_payment_basepoint(byte[] val)A payment key to channel initiator for transactions broadcast by counterpartyvoidset_require_confirmed_inputs(COption_NoneZ val)Optionally, a requirement that only confirmed inputs can be addedvoidset_revocation_basepoint(byte[] val)Used to derive a revocation key for transactions broadcast by counterpartyvoidset_second_per_commitment_point(byte[] val)The second to-be-broadcast-by-channel-initiator transaction's per commitment pointvoidset_shutdown_scriptpubkey(Option_CVec_u8ZZ val)Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we collaboratively closevoidset_temporary_channel_id(byte[] val)A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepointvoidset_to_self_delay(short val)The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transactionbyte[]write()Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_chain_hash
public byte[] get_chain_hash()
The genesis hash of the blockchain where the channel is to be opened
-
set_chain_hash
public void set_chain_hash(byte[] val)
The genesis hash of the blockchain where the channel is to be opened
-
get_temporary_channel_id
public byte[] get_temporary_channel_id()
A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
-
set_temporary_channel_id
public void set_temporary_channel_id(byte[] val)
A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
-
get_funding_feerate_sat_per_1000_weight
public int get_funding_feerate_sat_per_1000_weight()
The feerate for the funding transaction set by the channel initiator
-
set_funding_feerate_sat_per_1000_weight
public void set_funding_feerate_sat_per_1000_weight(int val)
The feerate for the funding transaction set by the channel initiator
-
get_commitment_feerate_sat_per_1000_weight
public int get_commitment_feerate_sat_per_1000_weight()
The feerate for the commitment transaction set by the channel initiator
-
set_commitment_feerate_sat_per_1000_weight
public void set_commitment_feerate_sat_per_1000_weight(int val)
The feerate for the commitment transaction set by the channel initiator
-
get_funding_satoshis
public long get_funding_satoshis()
Part of the channel value contributed by the channel initiator
-
set_funding_satoshis
public void set_funding_satoshis(long val)
Part of the channel value contributed by the channel initiator
-
get_dust_limit_satoshis
public long get_dust_limit_satoshis()
The threshold below which outputs on transactions broadcast by the channel initiator will be omitted
-
set_dust_limit_satoshis
public void set_dust_limit_satoshis(long val)
The threshold below which outputs on transactions broadcast by the channel initiator will be omitted
-
get_max_htlc_value_in_flight_msat
public long get_max_htlc_value_in_flight_msat()
The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
-
set_max_htlc_value_in_flight_msat
public void set_max_htlc_value_in_flight_msat(long val)
The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
-
get_htlc_minimum_msat
public long get_htlc_minimum_msat()
The minimum HTLC size incoming to channel initiator, in milli-satoshi
-
set_htlc_minimum_msat
public void set_htlc_minimum_msat(long val)
The minimum HTLC size incoming to channel initiator, in milli-satoshi
-
get_to_self_delay
public short get_to_self_delay()
The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
-
set_to_self_delay
public void set_to_self_delay(short val)
The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
-
get_max_accepted_htlcs
public short get_max_accepted_htlcs()
The maximum number of inbound HTLCs towards channel initiator
-
set_max_accepted_htlcs
public void set_max_accepted_htlcs(short val)
The maximum number of inbound HTLCs towards channel initiator
-
get_locktime
public int get_locktime()
The locktime for the funding transaction
-
set_locktime
public void set_locktime(int val)
The locktime for the funding transaction
-
get_funding_pubkey
public byte[] get_funding_pubkey()
The channel initiator's key controlling the funding transaction
-
set_funding_pubkey
public void set_funding_pubkey(byte[] val)
The channel initiator's key controlling the funding transaction
-
get_revocation_basepoint
public byte[] get_revocation_basepoint()
Used to derive a revocation key for transactions broadcast by counterparty
-
set_revocation_basepoint
public void set_revocation_basepoint(byte[] val)
Used to derive a revocation key for transactions broadcast by counterparty
-
get_payment_basepoint
public byte[] get_payment_basepoint()
A payment key to channel initiator for transactions broadcast by counterparty
-
set_payment_basepoint
public void set_payment_basepoint(byte[] val)
A payment key to channel initiator for transactions broadcast by counterparty
-
get_delayed_payment_basepoint
public byte[] get_delayed_payment_basepoint()
Used to derive a payment key to channel initiator for transactions broadcast by channel initiator
-
set_delayed_payment_basepoint
public void set_delayed_payment_basepoint(byte[] val)
Used to derive a payment key to channel initiator for transactions broadcast by channel initiator
-
get_htlc_basepoint
public byte[] get_htlc_basepoint()
Used to derive an HTLC payment key to channel initiator
-
set_htlc_basepoint
public void set_htlc_basepoint(byte[] val)
Used to derive an HTLC payment key to channel initiator
-
get_first_per_commitment_point
public byte[] get_first_per_commitment_point()
The first to-be-broadcast-by-channel-initiator transaction's per commitment point
-
set_first_per_commitment_point
public void set_first_per_commitment_point(byte[] val)
The first to-be-broadcast-by-channel-initiator transaction's per commitment point
-
get_second_per_commitment_point
public byte[] get_second_per_commitment_point()
The second to-be-broadcast-by-channel-initiator transaction's per commitment point
-
set_second_per_commitment_point
public void set_second_per_commitment_point(byte[] val)
The second to-be-broadcast-by-channel-initiator transaction's per commitment point
-
get_channel_flags
public byte get_channel_flags()
Channel flags
-
set_channel_flags
public void set_channel_flags(byte val)
Channel flags
-
get_shutdown_scriptpubkey
public Option_CVec_u8ZZ get_shutdown_scriptpubkey()
Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we collaboratively close
-
set_shutdown_scriptpubkey
public void set_shutdown_scriptpubkey(Option_CVec_u8ZZ val)
Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we collaboratively close
-
get_channel_type
@Nullable public ChannelTypeFeatures get_channel_type()
The channel type that this channel will represent. If none is set, we derive the channel type from the intersection of our feature bits with our counterparty's feature bits from the Init message. Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
-
set_channel_type
public void set_channel_type(@Nullable ChannelTypeFeatures val)
The channel type that this channel will represent. If none is set, we derive the channel type from the intersection of our feature bits with our counterparty's feature bits from the Init message. Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
-
get_require_confirmed_inputs
public COption_NoneZ get_require_confirmed_inputs()
Optionally, a requirement that only confirmed inputs can be added
-
set_require_confirmed_inputs
public void set_require_confirmed_inputs(COption_NoneZ val)
Optionally, a requirement that only confirmed inputs can be added
-
of
public static OpenChannelV2 of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, int funding_feerate_sat_per_1000_weight_arg, int commitment_feerate_sat_per_1000_weight_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, int locktime_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, byte channel_flags_arg, Option_CVec_u8ZZ shutdown_scriptpubkey_arg, @Nullable ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg)
Constructs a new OpenChannelV2 given each field Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
-
clone
public OpenChannelV2 clone()
Creates a copy of the OpenChannelV2
-
eq
public boolean eq(OpenChannelV2 b)
Checks if two OpenChannelV2s contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
write
public byte[] write()
Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
-
read
public static Result_OpenChannelV2DecodeErrorZ read(byte[] ser)
Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
-
-