pub struct Bridging {
pub provider: String,
pub destination_chain_id: String,
pub destination_token_address: String,
pub quote_id: Option<String>,
pub quote_signature: Option<String>,
pub attestation_signature: Option<String>,
pub quote_body: Option<String>,
}Expand description
Cross-chain bridging metadata.
Embedded in Metadata when an order was placed via a cross-chain
bridge (e.g. Across, Bungee). Records the bridge provider, destination
chain, destination token, and optional quote/attestation data so solvers
and analytics can trace cross-chain flows.
§Example
use cow_app_data::types::Bridging;
let bridging = Bridging::new("across", "42161", "0xTokenOnArbitrum").with_quote_id("quote-123");
assert!(bridging.has_quote_id());Fields§
§provider: StringBridge provider identifier.
destination_chain_id: StringDestination chain ID (as a decimal string).
destination_token_address: StringDestination token contract address.
quote_id: Option<String>Bridge quote identifier, if available.
quote_signature: Option<String>Bridge quote signature bytes, if available.
attestation_signature: Option<String>Bridge attestation signature bytes, if available.
quote_body: Option<String>Opaque bridge quote body, if available.
Implementations§
Source§impl Bridging
impl Bridging
Sourcepub fn new(
provider: impl Into<String>,
destination_chain_id: impl Into<String>,
destination_token_address: impl Into<String>,
) -> Self
pub fn new( provider: impl Into<String>, destination_chain_id: impl Into<String>, destination_token_address: impl Into<String>, ) -> Self
Construct a Bridging record with the three required fields.
Optional fields (quote ID, signatures, quote body) can be attached
afterwards via the with_* builder methods.
§Parameters
provider— bridge provider identifier (e.g."across","bungee").destination_chain_id— target chain ID as a decimal string (e.g."42161"for Arbitrum One).destination_token_address—0x-prefixed contract address of the token on the destination chain.
§Returns
A new Bridging with all optional fields set to None.
§Example
use cow_app_data::types::Bridging;
let b = Bridging::new("across", "42161", "0xTokenOnArbitrum");
assert_eq!(b.provider, "across");
assert!(!b.has_quote_id());Sourcepub fn with_quote_id(self, id: impl Into<String>) -> Self
pub fn with_quote_id(self, id: impl Into<String>) -> Self
Sourcepub fn with_quote_signature(self, sig: impl Into<String>) -> Self
pub fn with_quote_signature(self, sig: impl Into<String>) -> Self
Sourcepub fn with_attestation_signature(self, sig: impl Into<String>) -> Self
pub fn with_attestation_signature(self, sig: impl Into<String>) -> Self
Sourcepub fn with_quote_body(self, body: impl Into<String>) -> Self
pub fn with_quote_body(self, body: impl Into<String>) -> Self
Sourcepub const fn has_quote_id(&self) -> bool
pub const fn has_quote_id(&self) -> bool
Returns true if a bridge quote identifier is set.
Sourcepub const fn has_quote_signature(&self) -> bool
pub const fn has_quote_signature(&self) -> bool
Returns true if a bridge quote signature is set.
Sourcepub const fn has_attestation_signature(&self) -> bool
pub const fn has_attestation_signature(&self) -> bool
Returns true if an attestation signature is set.
Sourcepub const fn has_quote_body(&self) -> bool
pub const fn has_quote_body(&self) -> bool
Returns true if an opaque quote body is set.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Bridging
impl<'de> Deserialize<'de> for Bridging
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Bridging
impl RefUnwindSafe for Bridging
impl Send for Bridging
impl Sync for Bridging
impl Unpin for Bridging
impl UnsafeUnpin for Bridging
impl UnwindSafe for Bridging
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.