Skip to main content

SwapState

Struct SwapState 

Source
pub struct SwapState {
Show 48 fields pub protocol_version: String, pub swap_id: Uuid, pub swap_type: SwapType, pub status: String, pub receive_amount: u64, pub send_amount: u64, pub base_fee: u64, pub service_fee: u64, pub invoice_fee: Option<u64>, pub opening_tx_fee: Option<u64>, pub claim_tx_fee: Option<u64>, pub refund_tx_fee: Option<u64>, pub payment_hash: String, pub preimage: Option<String>, pub transitioned_at: u64, pub created_at: u64, pub error_type: Option<String>, pub cancel_message: Option<String>, pub source_chain: Option<Chain>, pub source_asset: Option<String>, pub source_csv: Option<u32>, pub source_txid: Option<String>, pub source_vout: Option<u32>, pub source_refund_pubkey: Option<String>, pub source_claim_pubkey: Option<String>, pub source_claim_privkey: Option<String>, pub source_user_blinding_pubkey: Option<String>, pub source_service_blinding_pubkey: Option<String>, pub dest_chain: Option<Chain>, pub dest_asset: Option<String>, pub dest_csv: Option<u32>, pub dest_txid: Option<String>, pub dest_vout: Option<u32>, pub dest_refund_pubkey: Option<String>, pub dest_claim_pubkey: Option<String>, pub dest_refund_privkey: Option<String>, pub user_claim_address: Option<String>, pub user_refund_address: Option<String>, pub server_claim_address: Option<String>, pub server_refund_address: Option<String>, pub source_claim_txid: Option<String>, pub dest_refund_txid: Option<String>, pub dest_user_blinding_pubkey: Option<String>, pub dest_service_blinding_pubkey: Option<String>, pub claim_invoice: Option<String>, pub create_request_body: Option<String>, pub create_request_timestamp: Option<i64>, pub create_request_signature: Option<String>,
}

Fields§

§protocol_version: String§swap_id: Uuid§swap_type: SwapType§status: String§receive_amount: u64§send_amount: u64§base_fee: u64§service_fee: u64§invoice_fee: Option<u64>§opening_tx_fee: Option<u64>§claim_tx_fee: Option<u64>§refund_tx_fee: Option<u64>§payment_hash: String§preimage: Option<String>§transitioned_at: u64§created_at: u64§error_type: Option<String>§cancel_message: Option<String>§source_chain: Option<Chain>§source_asset: Option<String>§source_csv: Option<u32>§source_txid: Option<String>§source_vout: Option<u32>§source_refund_pubkey: Option<String>§source_claim_pubkey: Option<String>§source_claim_privkey: Option<String>§source_user_blinding_pubkey: Option<String>

Liquid: the user’s blinding pubkey for the source output.

§source_service_blinding_pubkey: Option<String>

Liquid: anyswap’s blinding pubkey for the source output.

§dest_chain: Option<Chain>§dest_asset: Option<String>§dest_csv: Option<u32>§dest_txid: Option<String>§dest_vout: Option<u32>§dest_refund_pubkey: Option<String>§dest_claim_pubkey: Option<String>§dest_refund_privkey: Option<String>§user_claim_address: Option<String>§user_refund_address: Option<String>§server_claim_address: Option<String>

Address the server’s swap-in claim pays. Internal: redacted from HTTP responses by Self::into_api_response.

§server_refund_address: Option<String>

Address the server’s swap-out refund pays. Internal, as above.

§source_claim_txid: Option<String>

The server’s swap-in claim txid. Internal, as above.

§dest_refund_txid: Option<String>

The server’s swap-out refund txid. Internal, as above.

§dest_user_blinding_pubkey: Option<String>

Liquid: the user’s blinding pubkey for the destination output.

§dest_service_blinding_pubkey: Option<String>

Liquid: anyswap’s blinding pubkey for the destination output.

§claim_invoice: Option<String>§create_request_body: Option<String>

The POST /v1/swap body this swap was created from, verbatim. With the two fields below it lets a client verify the swap’s terms against its own signature rather than against this response. Returned by GET /v1/swap/{id}, and by the listing under with_create_request.

§create_request_timestamp: Option<i64>§create_request_signature: Option<String>

Hex of the 64-byte Schnorr signature over that request.

Implementations§

Source§

impl SwapState

Source

pub fn blind(self) -> SwapState

Redacts private keys not disclosed in the current status.

Source

pub fn into_api_response(self) -> SwapState

Redacts fields that must not be returned by public HTTP responses.

Source

pub fn without_create_request(self) -> SwapState

Drops the signed create request. A history page reads tens of swaps at a time and each body is the size of the swap itself, so a page carries them only when asked.

Trait Implementations§

Source§

impl Clone for SwapState

Source§

fn clone(&self) -> SwapState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SwapState

Source§

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

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

impl<'de> Deserialize<'de> for SwapState

Source§

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

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

impl Serialize for SwapState

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<SwapState> for SwapIn

Source§

type Error = SwapInError

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

fn try_from(s: SwapState) -> Result<Self, SwapInError>

Performs the conversion.
Source§

impl TryFrom<SwapState> for SwapOut

Source§

type Error = SwapOutError

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

fn try_from(s: SwapState) -> Result<Self, SwapOutError>

Performs the conversion.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> MaybeSend for T
where T: Send + ?Sized,

Source§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more