pub struct L2TxAttributes {
pub integrator_account_index: u64,
pub integrator_taker_fee: u32,
pub integrator_maker_fee: u32,
pub skip_nonce: u8,
pub cancel_all_market_index: Option<i64>,
pub self_trade_behavior_mode: Option<LighterSelfTradeBehaviorMode>,
pub self_trade_equality_mode: Option<LighterSelfTradeEqualityMode>,
}Expand description
Per-transaction L2 attributes.
Default-valued attributes do not contribute to the signed hash. Explicit self-trade defaults are still emitted in JSON and count toward the four-attribute limit.
Fields§
§integrator_account_index: u64Integrator account index.
integrator_taker_fee: u32Integrator taker fee in fee-tick units.
integrator_maker_fee: u32Integrator maker fee in fee-tick units.
skip_nonce: u81 to instruct the sequencer to skip nonce bookkeeping for this tx.
cancel_all_market_index: Option<i64>Cancel-all market attribute; None or 255 does not contribute to the hash.
CancelAllOrdersTxInfo does not carry this attribute.
self_trade_behavior_mode: Option<LighterSelfTradeBehaviorMode>Self-trade action; None leaves the venue default in force.
self_trade_equality_mode: Option<LighterSelfTradeEqualityMode>Self-trade account scope; None leaves the venue default in force.
Implementations§
Source§impl L2TxAttributes
impl L2TxAttributes
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true when no attribute contributes to the hash.
Explicit nil values can still occupy JSON entries. Encoders use only
the body hash when this returns true, matching upstream IsEmpty.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks attribute capacity and the venue’s self-trade restrictions.
§Errors
Returns an error if:
- The transaction exceeds the attribute limit.
- The cancel-all market index is invalid.
- Non-default self-trade modes combine with non-zero integrator fees.
- Reduce behavior combines with master-account equality.
Trait Implementations§
Source§impl Clone for L2TxAttributes
impl Clone for L2TxAttributes
impl Copy for L2TxAttributes
Source§impl Debug for L2TxAttributes
impl Debug for L2TxAttributes
Source§impl Default for L2TxAttributes
impl Default for L2TxAttributes
impl Eq for L2TxAttributes
Source§impl Hash for L2TxAttributes
impl Hash for L2TxAttributes
Source§impl PartialEq for L2TxAttributes
impl PartialEq for L2TxAttributes
impl StructuralPartialEq for L2TxAttributes
Auto Trait Implementations§
impl Freeze for L2TxAttributes
impl RefUnwindSafe for L2TxAttributes
impl Send for L2TxAttributes
impl Sync for L2TxAttributes
impl Unpin for L2TxAttributes
impl UnsafeUnpin for L2TxAttributes
impl UnwindSafe for L2TxAttributes
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more