use boundless_market::{
Client,
contracts::{FulfillmentData, RequestId, Requirements, Predicate, Offer},
storage::storage_provider_from_env,
request_builder::OfferParams,
};
use alloy::signers::local::PrivateKeySigner;
use alloy::primitives::U256;
use std::time::Duration;
use url::Url;
async fn proof_submission(signer: &PrivateKeySigner, rpc_url: Url) -> anyhow::Result<()> {
let client = Client::builder()
.with_rpc_url(rpc_url)
.with_private_key(signer.clone())
.with_storage_provider(Some(storage_provider_from_env()?))
.build()
.await?;
// Build the request.
let request = client.new_request()
.with_program(std::fs::read("guest.bin")?)
.with_stdin(42u32.to_le_bytes())
.with_offer(OfferParams::builder()
.ramp_up_period(30)
.lock_timeout(150)
.timeout(300)
);
// Submit the request onchain.
let (request_id, expires_at) = client.submit_onchain(request).await?;
let fulfillment = client
.wait_for_request_fulfillment(request_id, Duration::from_secs(10), expires_at)
.await?;
println!("FulfillmentData: {:?}, Seal: {:?}", fulfillment.data()?, fulfillment.seal);
Ok(())
}