Skip to main content

OpenChannelParams

Struct OpenChannelParams 

Source
pub struct OpenChannelParams {
Show 14 fields pub pubkey: Pubkey, pub funding_amount: u128, pub public: Option<bool>, pub one_way: Option<bool>, pub funding_udt_type_script: Option<Script>, pub shutdown_script: Option<Script>, pub commitment_delay_epoch: Option<EpochNumberWithFraction>, pub commitment_fee_rate: Option<u64>, pub funding_fee_rate: Option<u64>, pub tlc_expiry_delta: Option<u64>, pub tlc_min_value: Option<u128>, pub tlc_fee_proportional_millionths: Option<u128>, pub max_tlc_value_in_flight: Option<u128>, pub max_tlc_number_in_flight: Option<u64>,
}
Expand description

Parameters for opening a channel.

Fields§

§pubkey: Pubkey

The public key of the peer to open a channel with. The peer must be connected through the connect_peer rpc first.

§funding_amount: u128

The amount of CKB or UDT to fund the channel with.

§public: Option<bool>

Whether this is a public channel (will be broadcasted to network, and can be used to forward TLCs), an optional parameter, default value is true.

§one_way: Option<bool>

Whether this is a one-way channel (will not be broadcasted to network, and can only be used to send payment one way), an optional parameter, default value is false.

§funding_udt_type_script: Option<Script>

The type script of the UDT to fund the channel with, an optional parameter.

§shutdown_script: Option<Script>

The script used to receive the channel balance, an optional parameter, default value is the secp256k1_blake160_sighash_all script corresponding to the configured private key.

§commitment_delay_epoch: Option<EpochNumberWithFraction>

The delay time for the commitment transaction, must be an EpochNumberWithFraction in u64 format, an optional parameter, default value is 1 epoch, which is 4 hours.

§commitment_fee_rate: Option<u64>

The fee rate for the commitment transaction, an optional parameter.

§funding_fee_rate: Option<u64>

The fee rate for the funding transaction, an optional parameter.

§tlc_expiry_delta: Option<u64>

The expiry delta to forward a tlc, in milliseconds, default to 4 hours, which is 4 * 60 * 60 * 1000 milliseconds Expect it >= 2/3 commitment_delay_epoch. This parameter can be updated with rpc update_channel later.

§tlc_min_value: Option<u128>

The minimum value for a TLC our side can send, an optional parameter, default is 0, which means we can send any TLC is larger than 0. This parameter can be updated with rpc update_channel later.

§tlc_fee_proportional_millionths: Option<u128>

The fee proportional millionths for a TLC, proportional to the amount of the forwarded tlc. The unit is millionths of the amount. default is 1000 which means 0.1%. This parameter can be updated with rpc update_channel later. Not that, we use outbound channel to calculate the fee for TLC forwarding. For example, if we have a path A -> B -> C, then the fee B requires for TLC forwarding, is calculated the channel configuration of B and C, not A and B.

§max_tlc_value_in_flight: Option<u128>

The maximum total value of in-flight TLCs our side will accept from the peer, an optional parameter. This parameter can not be updated after channel is opened.

§max_tlc_number_in_flight: Option<u64>

The maximum number of in-flight TLCs our side will accept from the peer, an optional parameter, default is 125 This parameter can not be updated after channel is opened.

Trait Implementations§

Source§

impl Debug for OpenChannelParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OpenChannelParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for OpenChannelParams

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for OpenChannelParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V