Trait anchor_spl::dex::MarketMiddleware [−][src]
pub trait MarketMiddleware {
fn instruction(&mut self, _data: &mut &[u8]) -> ProgramResult { ... }
fn init_open_orders(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult { ... }
fn new_order_v3(
&self,
_ctx: &mut Context<'_, '_>,
_ix: &NewOrderInstructionV3
) -> ProgramResult { ... }
fn cancel_order_v2(
&self,
_ctx: &mut Context<'_, '_>,
_ix: &CancelOrderInstructionV2
) -> ProgramResult { ... }
fn cancel_order_by_client_id_v2(
&self,
_ctx: &mut Context<'_, '_>,
_client_id: u64
) -> ProgramResult { ... }
fn settle_funds(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult { ... }
fn close_open_orders(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult { ... }
fn prune(&self, _ctx: &mut Context<'_, '_>, _limit: u16) -> ProgramResult { ... }
fn fallback(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult { ... }
}
Expand description
Implementing this trait allows one to hook into requests to the Serum DEX via a frontend proxy.
Provided methods
fn instruction(&mut self, _data: &mut &[u8]) -> ProgramResult
fn instruction(&mut self, _data: &mut &[u8]) -> ProgramResult
Called before any instruction, giving middleware access to the raw instruction data. This can be used to access extra data that is prepended to the DEX data, allowing one to expand the capabilities of any instruction by reading the instruction data here and then using it in any of the method handlers.
fn init_open_orders(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult
fn new_order_v3(
&self,
_ctx: &mut Context<'_, '_>,
_ix: &NewOrderInstructionV3
) -> ProgramResult
fn cancel_order_v2(
&self,
_ctx: &mut Context<'_, '_>,
_ix: &CancelOrderInstructionV2
) -> ProgramResult
fn cancel_order_by_client_id_v2(
&self,
_ctx: &mut Context<'_, '_>,
_client_id: u64
) -> ProgramResult
fn settle_funds(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult
fn close_open_orders(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult
fn prune(&self, _ctx: &mut Context<'_, '_>, _limit: u16) -> ProgramResult
fn fallback(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult
fn fallback(&self, _ctx: &mut Context<'_, '_>) -> ProgramResult
Called when the instruction data doesn’t match any DEX instruction.