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:
Sending an order:
use parmigiana;
use OrderSender;
use TxCache;
let order_sender = new;
// Sign and submit in one call
let signed = order_sender.sign_and_send_order.await?;
Filling orders:
use ;
let submitter = new;
let filler = new;
// Fetch and fill
let orders: = filler.get_orders.try_collect.await?;
let response = filler.fill.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.