Skip to main content

boundless_market/
lib.rs

1// Copyright 2026 Boundless Foundation, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![cfg_attr(not(doctest), doc = include_str!("../README.md"))]
16#![cfg_attr(docsrs, feature(doc_cfg))]
17#![deny(missing_docs)]
18
19/// Peak performance thresholds for enabling requestor lists (kHz) for large requests.
20pub const LARGE_REQUESTOR_LIST_THRESHOLD_KHZ: f64 = 4000.0;
21/// Peak performance thresholds for enabling requestor lists (kHz) for XL requests.
22pub const XL_REQUESTOR_LIST_THRESHOLD_KHZ: f64 = 10000.0;
23
24/// Re-export of [alloy], provided to ensure that the correct version of the types used in the
25/// public API are available in case multiple versions of [alloy] are in use.
26///
27/// Because [alloy] is a v0.x crate, it is not covered under the semver policy of this crate.
28#[cfg(not(target_os = "zkvm"))]
29pub use alloy;
30
31/// A ProviderLayer module.
32///
33/// It can be added to an alloy Provider to log warnings and errors
34/// when the balance of a given address falls below certain thresholds.
35#[cfg(not(target_os = "zkvm"))]
36pub mod balance_alerts_layer;
37
38/// Client module for interacting with the Boundless Market API.
39#[cfg(not(target_os = "zkvm"))]
40pub mod client;
41#[cfg(not(target_os = "zkvm"))]
42pub use client::{Client, StandardClient};
43
44/// Client module for interacting with the Boundless Indexer API.
45#[cfg(not(target_os = "zkvm"))]
46pub mod indexer_client;
47/// Test helpers for testing the Boundless Market.
48#[cfg(all(feature = "test-utils", not(target_os = "zkvm")))]
49pub mod test_helpers;
50
51/// Contracts module for interacting with the Boundless Market smart contracts.
52pub mod contracts;
53#[cfg(not(target_os = "zkvm"))]
54/// Dynamic gas filler module.
55pub mod dynamic_gas_filler;
56#[cfg(not(target_os = "zkvm"))]
57pub use contracts::boundless_market::BoundlessMarketService;
58pub use contracts::{Offer, ProofRequest, RequestId, RequestInput, Requirements};
59
60/// Configs for deployments of the Boundless Market (e.g. contract addresses, URLs, etc).
61#[cfg(not(target_os = "zkvm"))]
62pub mod deployments;
63#[cfg(not(target_os = "zkvm"))]
64pub use deployments::Deployment;
65
66/// Input module for serializing input.
67#[cfg(not(target_os = "zkvm"))]
68pub mod input;
69#[cfg(not(target_os = "zkvm"))]
70pub use input::{GuestEnv, GuestEnvBuilder};
71
72/// Order stream client module for submitting requests off-chain.
73#[cfg(not(target_os = "zkvm"))]
74pub mod order_stream_client;
75
76#[cfg(not(target_os = "zkvm"))]
77/// A ProviderLayer module for managing nonces with semaphores.
78pub mod nonce_layer;
79#[cfg(not(target_os = "zkvm"))]
80pub use order_stream_client::OrderStreamClient;
81
82/// Module providing functionality to build requests.
83#[cfg(not(target_os = "zkvm"))]
84pub mod request_builder;
85#[cfg(not(target_os = "zkvm"))]
86pub use request_builder::ParameterizationMode;
87
88/// Module providing blake3-groth16 related integrations.
89#[cfg(all(feature = "blake3-groth16", not(target_os = "zkvm")))]
90pub mod blake3_groth16;
91
92/// Module providing market pricing functionality.
93#[cfg(not(target_os = "zkvm"))]
94pub mod price_provider;
95
96/// Selector module implementing utility functions for supported selectors.
97#[cfg(not(target_os = "zkvm"))]
98pub mod selector;
99
100/// Order pricing helpers and prover utilities.
101#[cfg(all(feature = "prover_utils", not(target_os = "zkvm")))]
102pub mod prover_utils;
103#[cfg(all(not(feature = "prover_utils"), not(target_os = "zkvm")))]
104pub(crate) mod prover_utils;
105
106/// Storage module for interacting with the storage uploader.
107#[cfg(not(target_os = "zkvm"))]
108pub mod storage;
109#[cfg(not(target_os = "zkvm"))]
110pub use storage::{
111    StandardDownloader, StandardUploader, StorageDownloaderConfig, StorageUploaderConfig,
112};
113
114/// Utility functions and types used elsewhere.
115pub(crate) mod util;
116pub use util::NotProvided;