6 releases
| new 0.16.0-rc.13 | Mar 6, 2026 |
|---|---|
| 0.16.0-rc.12 | Mar 2, 2026 |
| 0.16.0-rc.11 | Feb 16, 2026 |
| 0.0.1-alpha | Jan 7, 2026 |
#782 in Magic Beans
180 downloads per month
420KB
7.5K
SLoC
signet-orders
Utilities for placing and filling orders on Signet.
What's in this crate?
Sending orders:
OrderSender— high-level interface for signing and submitting off-chain orders. Generic over any alloySignerand anyOrderSubmitterbackend. Supports signingUnsignedOrders, on-chainOrderstructs, and combined sign-and-send in a single call.
Filling orders:
Filler— orchestrates the order-filling pipeline: fetch pending orders from anOrderSource, sign Permit2 fills, and submit them via aFillSubmitter. Returns a stream of orders and supports batch filling.FeePolicySubmitter— aFillSubmitterthat builds fill and initiate transactions, wraps them in aSignetEthBundle, and submits via aBundleSubmitter. Handles gas pricing for both rollup and host chains.FillerOptions— configure fill signing: Permit2 deadline offset and nonce.
Traits:
OrderSubmitter— submit signed orders to a backendOrderSource— fetch orders as a stream (with automatic pagination)FillSubmitter— submit signed fills (decouplesFillerfrom fee/tx logic)BundleSubmitter— submitSignetEthBundles to a backendTxBuilder— abstract over alloy'sFillProviderfor transaction filling
Ready-made implementations of OrderSubmitter, OrderSource, and
BundleSubmitter are provided for TxCache from signet-tx-cache.
Usage
Add the crate to your project:
cargo add signet-orders
Sending an order:
use signet_constants::parmigiana;
use signet_orders::OrderSender;
use signet_tx_cache::TxCache;
let order_sender = OrderSender::new(signer, TxCache::parmigiana(), parmigiana::system_constants());
// Sign and submit in one call
let signed = order_sender.sign_and_send_order(order).await?;
Filling orders:
use signet_orders::{Filler, FeePolicySubmitter, FillerOptions};
let submitter = FeePolicySubmitter::new(ru_provider, host_provider, tx_cache.clone(), constants.clone());
let filler = Filler::new(signer, tx_cache, submitter, constants, FillerOptions::new());
// Fetch and fill
let orders: Vec<_> = filler.get_orders().try_collect().await?;
let response = filler.fill(orders).await?;
For a complete example of a filler service, see signet-filler.
Documentation
- Working with Orders — overview of the Signet orders system
- API reference
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.
Dependencies
~73MB
~1.5M SLoC