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.
impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>
Instantiation and getters/setters.
Sourcepub const fn new(address: Address, __provider: P) -> Self
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.
Sourcepub fn set_address(&mut self, address: Address)
pub fn set_address(&mut self, address: Address)
Sets the address.
Source§impl<P: Clone, N> OrderBookInstance<&P, N>
impl<P: Clone, N> OrderBookInstance<&P, N>
Sourcepub fn with_cloned_provider(self) -> OrderBookInstance<P, N>
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.
impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>
Function calls.
Sourcepub fn call_builder<C: SolCall>(&self, call: &C) -> SolCallBuilder<&P, C, N>
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.
Sourcepub fn DEFAULT_ADMIN_ROLE(
&self,
) -> SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N>
pub fn DEFAULT_ADMIN_ROLE( &self, ) -> SolCallBuilder<&P, DEFAULT_ADMIN_ROLECall, N>
Creates a new call builder for the [DEFAULT_ADMIN_ROLE] function.
Sourcepub fn MAX_ORDERS_PER_BATCH(
&self,
) -> SolCallBuilder<&P, MAX_ORDERS_PER_BATCHCall, N>
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.
Sourcepub fn OPERATOR_ROLE(&self) -> SolCallBuilder<&P, OPERATOR_ROLECall, N>
pub fn OPERATOR_ROLE(&self) -> SolCallBuilder<&P, OPERATOR_ROLECall, N>
Creates a new call builder for the [OPERATOR_ROLE] function.
Sourcepub fn advanceBatch(
&self,
marketId: U256,
) -> SolCallBuilder<&P, advanceBatchCall, N>
pub fn advanceBatch( &self, marketId: U256, ) -> SolCallBuilder<&P, advanceBatchCall, N>
Creates a new call builder for the [advanceBatch] function.
Sourcepub fn askVolumeAt(
&self,
marketId: U256,
tick: U256,
) -> SolCallBuilder<&P, askVolumeAtCall, N>
pub fn askVolumeAt( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, askVolumeAtCall, N>
Creates a new call builder for the [askVolumeAt] function.
Sourcepub fn bidVolumeAt(
&self,
marketId: U256,
tick: U256,
) -> SolCallBuilder<&P, bidVolumeAtCall, N>
pub fn bidVolumeAt( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, bidVolumeAtCall, N>
Creates a new call builder for the [bidVolumeAt] function.
Sourcepub fn cancelExpiredOrder(
&self,
orderId: U256,
) -> SolCallBuilder<&P, cancelExpiredOrderCall, N>
pub fn cancelExpiredOrder( &self, orderId: U256, ) -> SolCallBuilder<&P, cancelExpiredOrderCall, N>
Creates a new call builder for the [cancelExpiredOrder] function.
Sourcepub fn cancelExpiredOrders(
&self,
orderIds: Vec<U256>,
) -> SolCallBuilder<&P, cancelExpiredOrdersCall, N>
pub fn cancelExpiredOrders( &self, orderIds: Vec<U256>, ) -> SolCallBuilder<&P, cancelExpiredOrdersCall, N>
Creates a new call builder for the [cancelExpiredOrders] function.
Sourcepub fn cancelOrder(
&self,
orderId: U256,
) -> SolCallBuilder<&P, cancelOrderCall, N>
pub fn cancelOrder( &self, orderId: U256, ) -> SolCallBuilder<&P, cancelOrderCall, N>
Creates a new call builder for the [cancelOrder] function.
Sourcepub fn cancelOrders(
&self,
orderIds: Vec<U256>,
) -> SolCallBuilder<&P, cancelOrdersCall, N>
pub fn cancelOrders( &self, orderIds: Vec<U256>, ) -> SolCallBuilder<&P, cancelOrdersCall, N>
Creates a new call builder for the [cancelOrders] function.
Sourcepub fn cumulativeAskVolume(
&self,
marketId: U256,
tick: U256,
) -> SolCallBuilder<&P, cumulativeAskVolumeCall, N>
pub fn cumulativeAskVolume( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, cumulativeAskVolumeCall, N>
Creates a new call builder for the [cumulativeAskVolume] function.
Sourcepub fn cumulativeBidVolume(
&self,
marketId: U256,
tick: U256,
) -> SolCallBuilder<&P, cumulativeBidVolumeCall, N>
pub fn cumulativeBidVolume( &self, marketId: U256, tick: U256, ) -> SolCallBuilder<&P, cumulativeBidVolumeCall, N>
Creates a new call builder for the [cumulativeBidVolume] function.
Sourcepub fn deactivateMarket(
&self,
marketId: U256,
) -> SolCallBuilder<&P, deactivateMarketCall, N>
pub fn deactivateMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, deactivateMarketCall, N>
Creates a new call builder for the [deactivateMarket] function.
Sourcepub fn feeModel(&self) -> SolCallBuilder<&P, feeModelCall, N>
pub fn feeModel(&self) -> SolCallBuilder<&P, feeModelCall, N>
Creates a new call builder for the [feeModel] function.
Sourcepub fn findClearingTick(
&self,
marketId: U256,
) -> SolCallBuilder<&P, findClearingTickCall, N>
pub fn findClearingTick( &self, marketId: U256, ) -> SolCallBuilder<&P, findClearingTickCall, N>
Creates a new call builder for the [findClearingTick] function.
Sourcepub fn getBatchOrderIds(
&self,
marketId: U256,
batchId: U256,
) -> SolCallBuilder<&P, getBatchOrderIdsCall, N>
pub fn getBatchOrderIds( &self, marketId: U256, batchId: U256, ) -> SolCallBuilder<&P, getBatchOrderIdsCall, N>
Creates a new call builder for the [getBatchOrderIds] function.
Sourcepub fn getRoleAdmin(
&self,
role: FixedBytes<32>,
) -> SolCallBuilder<&P, getRoleAdminCall, N>
pub fn getRoleAdmin( &self, role: FixedBytes<32>, ) -> SolCallBuilder<&P, getRoleAdminCall, N>
Creates a new call builder for the [getRoleAdmin] function.
Sourcepub fn grantRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, grantRoleCall, N>
pub fn grantRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, grantRoleCall, N>
Creates a new call builder for the [grantRole] function.
Sourcepub fn haltMarket(
&self,
marketId: U256,
) -> SolCallBuilder<&P, haltMarketCall, N>
pub fn haltMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, haltMarketCall, N>
Creates a new call builder for the [haltMarket] function.
Sourcepub fn hasRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, hasRoleCall, N>
pub fn hasRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, hasRoleCall, N>
Creates a new call builder for the [hasRole] function.
Sourcepub fn markets(&self, _0: U256) -> SolCallBuilder<&P, marketsCall, N>
pub fn markets(&self, _0: U256) -> SolCallBuilder<&P, marketsCall, N>
Creates a new call builder for the [markets] function.
Sourcepub fn nextMarketId(&self) -> SolCallBuilder<&P, nextMarketIdCall, N>
pub fn nextMarketId(&self) -> SolCallBuilder<&P, nextMarketIdCall, N>
Creates a new call builder for the [nextMarketId] function.
Sourcepub fn nextOrderId(&self) -> SolCallBuilder<&P, nextOrderIdCall, N>
pub fn nextOrderId(&self) -> SolCallBuilder<&P, nextOrderIdCall, N>
Creates a new call builder for the [nextOrderId] function.
Sourcepub fn onERC1155BatchReceived(
&self,
_0: Address,
_1: Address,
_2: Vec<U256>,
_3: Vec<U256>,
_4: Bytes,
) -> SolCallBuilder<&P, onERC1155BatchReceivedCall, N>
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.
Sourcepub fn onERC1155Received(
&self,
_0: Address,
_1: Address,
_2: U256,
_3: U256,
_4: Bytes,
) -> SolCallBuilder<&P, onERC1155ReceivedCall, N>
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.
Sourcepub fn orders(&self, _0: U256) -> SolCallBuilder<&P, ordersCall, N>
pub fn orders(&self, _0: U256) -> SolCallBuilder<&P, ordersCall, N>
Creates a new call builder for the [orders] function.
Sourcepub fn outcomeToken(&self) -> SolCallBuilder<&P, outcomeTokenCall, N>
pub fn outcomeToken(&self) -> SolCallBuilder<&P, outcomeTokenCall, N>
Creates a new call builder for the [outcomeToken] function.
Sourcepub fn placeOrder(
&self,
marketId: U256,
side: <Side as SolType>::RustType,
orderType: <OrderType as SolType>::RustType,
tick: U256,
lots: U256,
) -> SolCallBuilder<&P, placeOrderCall, N>
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.
Sourcepub fn placeOrders(
&self,
marketId: U256,
params: Vec<<OrderParam as SolType>::RustType>,
) -> SolCallBuilder<&P, placeOrdersCall, N>
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.
Sourcepub fn pushBatchOrderId(
&self,
marketId: U256,
batchId: U256,
orderId: U256,
) -> SolCallBuilder<&P, pushBatchOrderIdCall, N>
pub fn pushBatchOrderId( &self, marketId: U256, batchId: U256, orderId: U256, ) -> SolCallBuilder<&P, pushBatchOrderIdCall, N>
Creates a new call builder for the [pushBatchOrderId] function.
Sourcepub fn reduceOrderLots(
&self,
orderId: U256,
lotsToReduce: U256,
) -> SolCallBuilder<&P, reduceOrderLotsCall, N>
pub fn reduceOrderLots( &self, orderId: U256, lotsToReduce: U256, ) -> SolCallBuilder<&P, reduceOrderLotsCall, N>
Creates a new call builder for the [reduceOrderLots] function.
Sourcepub fn registerMarket(
&self,
minLots: U256,
batchInterval: U256,
expiryTime: U256,
) -> SolCallBuilder<&P, registerMarketCall, N>
pub fn registerMarket( &self, minLots: U256, batchInterval: U256, expiryTime: U256, ) -> SolCallBuilder<&P, registerMarketCall, N>
Creates a new call builder for the [registerMarket] function.
Sourcepub fn renounceRole(
&self,
role: FixedBytes<32>,
callerConfirmation: Address,
) -> SolCallBuilder<&P, renounceRoleCall, N>
pub fn renounceRole( &self, role: FixedBytes<32>, callerConfirmation: Address, ) -> SolCallBuilder<&P, renounceRoleCall, N>
Creates a new call builder for the [renounceRole] function.
Sourcepub fn replaceOrders(
&self,
cancelIds: Vec<U256>,
marketId: U256,
params: Vec<<OrderParam as SolType>::RustType>,
) -> SolCallBuilder<&P, replaceOrdersCall, N>
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.
Sourcepub fn resumeMarket(
&self,
marketId: U256,
) -> SolCallBuilder<&P, resumeMarketCall, N>
pub fn resumeMarket( &self, marketId: U256, ) -> SolCallBuilder<&P, resumeMarketCall, N>
Creates a new call builder for the [resumeMarket] function.
Sourcepub fn revokeRole(
&self,
role: FixedBytes<32>,
account: Address,
) -> SolCallBuilder<&P, revokeRoleCall, N>
pub fn revokeRole( &self, role: FixedBytes<32>, account: Address, ) -> SolCallBuilder<&P, revokeRoleCall, N>
Creates a new call builder for the [revokeRole] function.
Sourcepub fn supportsInterface(
&self,
interfaceId: FixedBytes<4>,
) -> SolCallBuilder<&P, supportsInterfaceCall, N>
pub fn supportsInterface( &self, interfaceId: FixedBytes<4>, ) -> SolCallBuilder<&P, supportsInterfaceCall, N>
Creates a new call builder for the [supportsInterface] function.
Sourcepub fn totalAskVolume(
&self,
marketId: U256,
) -> SolCallBuilder<&P, totalAskVolumeCall, N>
pub fn totalAskVolume( &self, marketId: U256, ) -> SolCallBuilder<&P, totalAskVolumeCall, N>
Creates a new call builder for the [totalAskVolume] function.
Sourcepub fn totalBidVolume(
&self,
marketId: U256,
) -> SolCallBuilder<&P, totalBidVolumeCall, N>
pub fn totalBidVolume( &self, marketId: U256, ) -> SolCallBuilder<&P, totalBidVolumeCall, N>
Creates a new call builder for the [totalBidVolume] function.
Sourcepub fn transferEscrowTokens(
&self,
to: Address,
tokenId: U256,
amount: U256,
) -> SolCallBuilder<&P, transferEscrowTokensCall, N>
pub fn transferEscrowTokens( &self, to: Address, tokenId: U256, amount: U256, ) -> SolCallBuilder<&P, transferEscrowTokensCall, N>
Creates a new call builder for the [transferEscrowTokens] function.
Sourcepub fn updateTreeVolume(
&self,
marketId: U256,
side: <Side as SolType>::RustType,
tick: U256,
delta: I256,
) -> SolCallBuilder<&P, updateTreeVolumeCall, N>
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.
Sourcepub fn vault(&self) -> SolCallBuilder<&P, vaultCall, N>
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.
impl<P: Provider<N>, N: Network> OrderBookInstance<P, N>
Event filters.
Sourcepub fn event_filter<E: SolEvent>(&self) -> Event<&P, E, N>
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.
Sourcepub fn MarketDeactivated_filter(&self) -> Event<&P, MarketDeactivated, N>
pub fn MarketDeactivated_filter(&self) -> Event<&P, MarketDeactivated, N>
Creates a new event filter for the MarketDeactivated event.
Sourcepub fn MarketHalted_filter(&self) -> Event<&P, MarketHalted, N>
pub fn MarketHalted_filter(&self) -> Event<&P, MarketHalted, N>
Creates a new event filter for the MarketHalted event.
Sourcepub fn MarketRegistered_filter(&self) -> Event<&P, MarketRegistered, N>
pub fn MarketRegistered_filter(&self) -> Event<&P, MarketRegistered, N>
Creates a new event filter for the MarketRegistered event.
Sourcepub fn MarketResumed_filter(&self) -> Event<&P, MarketResumed, N>
pub fn MarketResumed_filter(&self) -> Event<&P, MarketResumed, N>
Creates a new event filter for the MarketResumed event.
Sourcepub fn OrderCancelled_filter(&self) -> Event<&P, OrderCancelled, N>
pub fn OrderCancelled_filter(&self) -> Event<&P, OrderCancelled, N>
Creates a new event filter for the OrderCancelled event.
Sourcepub fn OrderPlaced_filter(&self) -> Event<&P, OrderPlaced, N>
pub fn OrderPlaced_filter(&self) -> Event<&P, OrderPlaced, N>
Creates a new event filter for the OrderPlaced event.
Sourcepub fn RoleAdminChanged_filter(&self) -> Event<&P, RoleAdminChanged, N>
pub fn RoleAdminChanged_filter(&self) -> Event<&P, RoleAdminChanged, N>
Creates a new event filter for the RoleAdminChanged event.
Sourcepub fn RoleGranted_filter(&self) -> Event<&P, RoleGranted, N>
pub fn RoleGranted_filter(&self) -> Event<&P, RoleGranted, N>
Creates a new event filter for the RoleGranted event.
Sourcepub fn RoleRevoked_filter(&self) -> Event<&P, RoleRevoked, N>
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>
impl<P: Clone, N: Clone> Clone for OrderBookInstance<P, N>
Source§fn clone(&self) -> OrderBookInstance<P, N>
fn clone(&self) -> OrderBookInstance<P, N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<P, N> Freeze for OrderBookInstance<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for OrderBookInstance<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for OrderBookInstance<P, N>
impl<P, N> Sync for OrderBookInstance<P, N>
impl<P, N> Unpin for OrderBookInstance<P, N>
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> 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 more