Skip to main content

OrderBookInstance

Struct OrderBookInstance 

Source
pub struct OrderBookInstance<P, N = Ethereum> { /* private fields */ }
Expand description

A OrderBook instance.

Contains type-safe methods for interacting with an on-chain instance of the OrderBook contract located at a given address, using a given provider P.

If the contract bytecode is available (see the sol! documentation on how to provide it), the deploy and deploy_builder methods can be used to deploy a new instance of the contract.

See the module-level documentation for all the available methods.

Implementations§

Source§

impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>

Instantiation and getters/setters.

Source

pub const fn new(address: Address, __provider: P) -> Self

Creates a new wrapper around an on-chain OrderBook contract instance.

See the wrapper’s documentation for more details.

Source

pub const fn address(&self) -> &Address

Returns a reference to the address.

Source

pub fn set_address(&mut self, address: Address)

Sets the address.

Source

pub fn at(self, address: Address) -> Self

Sets the address and returns self.

Source

pub const fn provider(&self) -> &P

Returns a reference to the provider.

Source§

impl<P: Clone, N> OrderBookInstance<&P, N>

Source

pub fn with_cloned_provider(self) -> OrderBookInstance<P, N>

Clones the provider and returns a new instance with the cloned provider.

Source§

impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>

Function calls.

Source

pub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>

Creates a new call builder using this contract instance’s provider and address.

Note that the call can be any function call, not just those defined in this contract. Prefer using the other methods for building type-safe contract calls.

Source

pub fn DEFAULT_ADMIN_ROLE( &self, ) -> SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N>

Creates a new call builder for the [DEFAULT_ADMIN_ROLE] function.

Source

pub fn MAX_ORDERS_PER_BATCH( &self, ) -> SolCallBuilder<&P, MAX_ORDERS_PER_BATCHCall, N>

Creates a new call builder for the [MAX_ORDERS_PER_BATCH] function.

Source

pub fn OPERATOR_ROLE(&self) -> SolCallBuilder<&P, OPERATOR_ROLECall, N>

Creates a new call builder for the [OPERATOR_ROLE] function.

Source

pub fn advanceBatch( &self, marketId: U256, ) -> SolCallBuilder<&P, advanceBatchCall, N>

Creates a new call builder for the [advanceBatch] function.

Source

pub fn askVolumeAt( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, askVolumeAtCall, N>

Creates a new call builder for the [askVolumeAt] function.

Source

pub fn bidVolumeAt( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, bidVolumeAtCall, N>

Creates a new call builder for the [bidVolumeAt] function.

Source

pub fn cancelExpiredOrder( &self, orderId: U256, ) -> SolCallBuilder<&P, cancelExpiredOrderCall, N>

Creates a new call builder for the [cancelExpiredOrder] function.

Source

pub fn cancelExpiredOrders( &self, orderIds: Vec<U256>, ) -> SolCallBuilder<&P, cancelExpiredOrdersCall, N>

Creates a new call builder for the [cancelExpiredOrders] function.

Source

pub fn cancelOrder( &self, orderId: U256, ) -> SolCallBuilder<&P, cancelOrderCall, N>

Creates a new call builder for the [cancelOrder] function.

Source

pub fn cancelOrders( &self, orderIds: Vec<U256>, ) -> SolCallBuilder<&P, cancelOrdersCall, N>

Creates a new call builder for the [cancelOrders] function.

Source

pub fn cumulativeAskVolume( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, cumulativeAskVolumeCall, N>

Creates a new call builder for the [cumulativeAskVolume] function.

Source

pub fn cumulativeBidVolume( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, cumulativeBidVolumeCall, N>

Creates a new call builder for the [cumulativeBidVolume] function.

Source

pub fn deactivateMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, deactivateMarketCall, N>

Creates a new call builder for the [deactivateMarket] function.

Source

pub fn feeModel(&self) -> SolCallBuilder<&P, feeModelCall, N>

Creates a new call builder for the [feeModel] function.

Source

pub fn findClearingTick( &self, marketId: U256, ) -> SolCallBuilder<&P, findClearingTickCall, N>

Creates a new call builder for the [findClearingTick] function.

Source

pub fn getBatchOrderIds( &self, marketId: U256, batchId: U256, ) -> SolCallBuilder<&P, getBatchOrderIdsCall, N>

Creates a new call builder for the [getBatchOrderIds] function.

Source

pub fn getRoleAdmin( &self, role: FixedBytes<32>, ) -> SolCallBuilder<&P, getRoleAdminCall, N>

Creates a new call builder for the [getRoleAdmin] function.

Source

pub fn grantRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, grantRoleCall, N>

Creates a new call builder for the [grantRole] function.

Source

pub fn haltMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, haltMarketCall, N>

Creates a new call builder for the [haltMarket] function.

Source

pub fn hasRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, hasRoleCall, N>

Creates a new call builder for the [hasRole] function.

Source

pub fn markets(&self, _0: U256) -> SolCallBuilder<&P, marketsCall, N>

Creates a new call builder for the [markets] function.

Source

pub fn nextMarketId(&self) -> SolCallBuilder<&P, nextMarketIdCall, N>

Creates a new call builder for the [nextMarketId] function.

Source

pub fn nextOrderId(&self) -> SolCallBuilder<&P, nextOrderIdCall, N>

Creates a new call builder for the [nextOrderId] function.

Source

pub fn onERC1155BatchReceived( &self, _0: Address, _1: Address, _2: Vec<U256>, _3: Vec<U256>, _4: Bytes, ) -> SolCallBuilder<&P, onERC1155BatchReceivedCall, N>

Creates a new call builder for the [onERC1155BatchReceived] function.

Source

pub fn onERC1155Received( &self, _0: Address, _1: Address, _2: U256, _3: U256, _4: Bytes, ) -> SolCallBuilder<&P, onERC1155ReceivedCall, N>

Creates a new call builder for the [onERC1155Received] function.

Source

pub fn orders(&self, _0: U256) -> SolCallBuilder<&P, ordersCall, N>

Creates a new call builder for the [orders] function.

Source

pub fn outcomeToken(&self) -> SolCallBuilder<&P, outcomeTokenCall, N>

Creates a new call builder for the [outcomeToken] function.

Source

pub fn placeOrder( &self, marketId: U256, side: <Side as SolType>::RustType, orderType: <OrderType as SolType>::RustType, tick: U256, lots: U256, ) -> SolCallBuilder<&P, placeOrderCall, N>

Creates a new call builder for the [placeOrder] function.

Source

pub fn placeOrders( &self, marketId: U256, params: Vec<<OrderParam as SolType>::RustType>, ) -> SolCallBuilder<&P, placeOrdersCall, N>

Creates a new call builder for the [placeOrders] function.

Source

pub fn pushBatchOrderId( &self, marketId: U256, batchId: U256, orderId: U256, ) -> SolCallBuilder<&P, pushBatchOrderIdCall, N>

Creates a new call builder for the [pushBatchOrderId] function.

Source

pub fn reduceOrderLots( &self, orderId: U256, lotsToReduce: U256, ) -> SolCallBuilder<&P, reduceOrderLotsCall, N>

Creates a new call builder for the [reduceOrderLots] function.

Source

pub fn registerMarket( &self, minLots: U256, batchInterval: U256, expiryTime: U256, ) -> SolCallBuilder<&P, registerMarketCall, N>

Creates a new call builder for the [registerMarket] function.

Source

pub fn renounceRole( &self, role: FixedBytes<32>, callerConfirmation: Address, ) -> SolCallBuilder<&P, renounceRoleCall, N>

Creates a new call builder for the [renounceRole] function.

Source

pub fn replaceOrders( &self, cancelIds: Vec<U256>, marketId: U256, params: Vec<<OrderParam as SolType>::RustType>, ) -> SolCallBuilder<&P, replaceOrdersCall, N>

Creates a new call builder for the [replaceOrders] function.

Source

pub fn resumeMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, resumeMarketCall, N>

Creates a new call builder for the [resumeMarket] function.

Source

pub fn revokeRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, revokeRoleCall, N>

Creates a new call builder for the [revokeRole] function.

Source

pub fn supportsInterface( &self, interfaceId: FixedBytes<4>, ) -> SolCallBuilder<&P, supportsInterfaceCall, N>

Creates a new call builder for the [supportsInterface] function.

Source

pub fn totalAskVolume( &self, marketId: U256, ) -> SolCallBuilder<&P, totalAskVolumeCall, N>

Creates a new call builder for the [totalAskVolume] function.

Source

pub fn totalBidVolume( &self, marketId: U256, ) -> SolCallBuilder<&P, totalBidVolumeCall, N>

Creates a new call builder for the [totalBidVolume] function.

Source

pub fn transferEscrowTokens( &self, to: Address, tokenId: U256, amount: U256, ) -> SolCallBuilder<&P, transferEscrowTokensCall, N>

Creates a new call builder for the [transferEscrowTokens] function.

Source

pub fn updateTreeVolume( &self, marketId: U256, side: <Side as SolType>::RustType, tick: U256, delta: I256, ) -> SolCallBuilder<&P, updateTreeVolumeCall, N>

Creates a new call builder for the [updateTreeVolume] function.

Source

pub fn vault(&self) -> SolCallBuilder<&P, vaultCall, N>

Creates a new call builder for the [vault] function.

Source§

impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>

Event filters.

Source

pub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>

Creates a new event filter using this contract instance’s provider and address.

Note that the type can be any event, not just those defined in this contract. Prefer using the other methods for building type-safe event filters.

Source

pub fn MarketDeactivated_filter(&self) -> Event<&P, MarketDeactivated, N>

Creates a new event filter for the MarketDeactivated event.

Source

pub fn MarketHalted_filter(&self) -> Event<&P, MarketHalted, N>

Creates a new event filter for the MarketHalted event.

Source

pub fn MarketRegistered_filter(&self) -> Event<&P, MarketRegistered, N>

Creates a new event filter for the MarketRegistered event.

Source

pub fn MarketResumed_filter(&self) -> Event<&P, MarketResumed, N>

Creates a new event filter for the MarketResumed event.

Source

pub fn OrderCancelled_filter(&self) -> Event<&P, OrderCancelled, N>

Creates a new event filter for the OrderCancelled event.

Source

pub fn OrderPlaced_filter(&self) -> Event<&P, OrderPlaced, N>

Creates a new event filter for the OrderPlaced event.

Source

pub fn RoleAdminChanged_filter(&self) -> Event<&P, RoleAdminChanged, N>

Creates a new event filter for the RoleAdminChanged event.

Source

pub fn RoleGranted_filter(&self) -> Event<&P, RoleGranted, N>

Creates a new event filter for the RoleGranted event.

Source

pub fn RoleRevoked_filter(&self) -> Event<&P, RoleRevoked, N>

Creates a new event filter for the RoleRevoked event.

Trait Implementations§

Source§

impl<P: Clone, N: Clone> Clone for OrderBookInstance<P, N>

Source§

fn clone(&self) -> OrderBookInstance<P, N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<P, N> Debug for OrderBookInstance<P, N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P, N> Freeze for OrderBookInstance<P, N>
where P: Freeze,

§

impl<P, N> RefUnwindSafe for OrderBookInstance<P, N>

§

impl<P, N> Send for OrderBookInstance<P, N>
where P: Send, N: Send,

§

impl<P, N> Sync for OrderBookInstance<P, N>
where P: Sync, N: Sync,

§

impl<P, N> Unpin for OrderBookInstance<P, N>
where P: Unpin, N: Unpin,

§

impl<P, N> UnsafeUnpin for OrderBookInstance<P, N>
where P: UnsafeUnpin,

§

impl<P, N> UnwindSafe for OrderBookInstance<P, N>
where P: UnwindSafe, N: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryClone for T
where T: Clone,

Source§

fn try_clone(&self) -> Result<T, Error>

Clones self, possibly returning an error.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more