pub struct ContractFeatures { /* private fields */ }Expand description
Feature set of the deployed exchange smart contract.
Each flag guards a group of selectors/events introduced by a single release,
so the SDK can index and snapshot a contract that has not been upgraded to
the revision the SDK targets (crate::state::Exchange::revision).
Implementations§
Source§impl ContractFeatures
impl ContractFeatures
Sourcepub fn current() -> Self
pub fn current() -> Self
Everything the SDK targets, with no version reported. Useful as a default for locally deployed contracts built from the SDK’s own ABI.
Sourcepub fn of(version: ContractVersion) -> Self
pub fn of(version: ContractVersion) -> Self
Feature set of a known contract version.
Sourcepub fn version(&self) -> Option<ContractVersion>
pub fn version(&self) -> Option<ContractVersion>
Version reported by the contract, if it exposes getContractVersion
(v1.1.7.4+).
Sourcepub fn v2_state_getters(&self) -> bool
pub fn v2_state_getters(&self) -> bool
getPerpetualInfoV2 / getPositionV2 and the V2 position events
(fundingSumScalingExp, priceResiduePNSQ16) are available.
Sourcepub fn keyed_fee_schedules(&self) -> bool
pub fn keyed_fee_schedules(&self) -> bool
Keyed 8-tier fee schedules with per-account fee tiers are available
(getPerpFeeSchedule, getFeeScheduleById, getAccountFeeTier and
the FeeScheduleSet / DefaultPerpFeeScheduleSet /
DefaultRwaFeeScheduleSet / PerpFeeSchedIdSet /
AccountFeeTierSet events).
Sourcepub fn builder_attribution(&self) -> bool
pub fn builder_attribution(&self) -> bool
Builder attribution is available (execOrderV2 and friends,
getOrderV2 and the OrderRequestV2 / MakerOrderFilledV2 /
TakerOrderFilledV2 events).
Sourcepub fn perpetual_discovery(&self) -> bool
pub fn perpetual_discovery(&self) -> bool
The perpetual-existence bitmap is available
(getPerpetualExistsBitmap), so the set of listed perpetuals can be
discovered on-chain instead of being configured.
Trait Implementations§
Source§impl Clone for ContractFeatures
impl Clone for ContractFeatures
Source§fn clone(&self) -> ContractFeatures
fn clone(&self) -> ContractFeatures
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ContractFeatures
Source§impl Debug for ContractFeatures
impl Debug for ContractFeatures
Source§impl Default for ContractFeatures
impl Default for ContractFeatures
Auto Trait Implementations§
impl Freeze for ContractFeatures
impl RefUnwindSafe for ContractFeatures
impl Send for ContractFeatures
impl Sync for ContractFeatures
impl Unpin for ContractFeatures
impl UnsafeUnpin for ContractFeatures
impl UnwindSafe for ContractFeatures
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> 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 moreSource§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.