pub struct MarketHooks { /* private fields */ }Implementations§
Source§impl MarketHooks
impl MarketHooks
pub const fn base(&self) -> Option<&Hook>
pub const fn quote(&self) -> Option<&Hook>
Sourcepub fn plan(
&self,
base: (&Address, &MintState),
quote: (&Address, &MintState),
) -> HookPlan
pub fn plan( &self, base: (&Address, &MintState), quote: (&Address, &MintState), ) -> HookPlan
Plans a refresh from the current mint states. A validation address is derived again only when its hook program changes.
Sourcepub fn screen(self, trade: &StandInTrade, fixed: &[AccountMeta]) -> Self
pub fn screen(self, trade: &StandInTrade, fixed: &[AccountMeta]) -> Self
Marks each hook unresolvable if a buy or a sell cannot include it. The
result applies to every trader. fixed must be the instruction accounts
of trade.
Sourcepub fn validation_accounts(&self) -> impl Iterator<Item = Address> + '_
pub fn validation_accounts(&self) -> impl Iterator<Item = Address> + '_
The validation accounts of the current hooks. Fetch them for the next refresh.
pub fn check_routable(&self, unloaded: Unloaded) -> Result<(), HookError>
pub fn programs(&self) -> Vec<Address>
Sourcepub fn swap_accounts(
&self,
swap: HookSwap<'_>,
unloaded: Unloaded,
) -> Result<Vec<AccountMeta>, HookError>
pub fn swap_accounts( &self, swap: HookSwap<'_>, unloaded: Unloaded, ) -> Result<Vec<AccountMeta>, HookError>
The hook accounts of both legs, merged. Append them after swap.fixed.
Trait Implementations§
Source§impl Clone for MarketHooks
impl Clone for MarketHooks
Source§impl Debug for MarketHooks
impl Debug for MarketHooks
Source§impl Default for MarketHooks
impl Default for MarketHooks
impl Eq for MarketHooks
Source§impl PartialEq for MarketHooks
impl PartialEq for MarketHooks
impl StructuralPartialEq for MarketHooks
Auto Trait Implementations§
impl Freeze for MarketHooks
impl RefUnwindSafe for MarketHooks
impl Send for MarketHooks
impl Sync for MarketHooks
impl Unpin for MarketHooks
impl UnsafeUnpin for MarketHooks
impl UnwindSafe for MarketHooks
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
Mutably borrows from an owned value. Read more