nexum-sdk is the guest-side library every module consumes: typed primitives, ABI helpers, an effect-trait seam for testing, the #[nexum_sdk::module] attribute macro and per-module adapter macro, and a prelude that keeps boilerplate out of module crates. videre-sdk layers the venue surface on top: the typed venue client, the intent-body codec, the VenueAdapter seam and the keeper run. Modules that talk to a venue depend on both crates and import each directly (nothing is re-exported between them).
This page is the entry point. The full API reference is the rustdoc site under target/doc/nexum_sdk/ and target/doc/videre_sdk/, generated by:
RUSTDOCFLAGS="-D warnings -D missing-docs" cargo doc -p nexum-sdk -p videre-sdk -p nexum-module-macros -p videre-macros --no-deps --openModules are authored with the #[nexum_sdk::module] attribute (re-exported from nexum-module-macros). Apply it to an inherent impl block whose associated functions are the named event handlers - init, on_block, on_chain_logs, on_tick, on_message - each taking its wit-bindgen payload and returning Result<(), Fault>. The macro generates the rest of the per-cdylib glue: the wit_bindgen::generate! call, the bind_host_via_wit_bindgen!() adapter, a Guest impl whose on_event dispatches to whichever handlers are present (absent handlers no-op), and export!. See doc 05 for a worked example and the nexum-module-macros rustdoc for the fine print.
The SDK is host-neutral - it does not call wit-bindgen-generated functions directly. Instead, it exposes traits that mirror the on-the-wire host interfaces, and modules adapt their wit-bindgen imports to the traits at the cdylib boundary (the bind_host_via_wit_bindgen! macro generates that adapter). The traits in [nexum_sdk::host][host-doc] and the venue seam in [videre_sdk::client][client-doc] are:
| Trait | Mirrors | What it does |
|---|---|---|
ChainHost |
nexum:host/chain@0.1.0 |
JSON-RPC dispatch (eth_call, eth_getLogs, …) |
LocalStoreHost |
nexum:host/local-store@0.1.0 |
Per-module key-value store |
LoggingHost |
nexum:host/logging@0.1.0 |
Structured log lines tagged by module |
Host |
supertrait | Bundles the three core traits; blanket impl |
VenueTransport (videre-sdk) |
videre:venue/client@0.1.0 |
Quote, submit, observe, status and cancel against an installed venue adapter |
A module declaring [capabilities].required = ["chain", "local-store", "client", "logging"] in its module.toml matches the host trait seam one-for-one.
[host-doc]: ../target/doc/nexum_sdk/host/index.html [client-doc]: ../target/doc/videre_sdk/client/index.html
-
- bulk re-exports covering the alloy primitives (
Address,B256,Bytes,U256,keccak256).videre-sdkhas no prelude; it re-exports its surface from the crate root.
- bulk re-exports covering the alloy primitives (
-
client- the typed venue seam (invidere-sdk): aVenuemarker drivesVenueClient, which encodes throughIntentBodybefore the byte-levelVenueTransportseam.keeper::retry_actionfolds aVenueFaultinto aRetryAction. -
CoW-specific pieces live in their own L3 crates rather than the SDK:
cow_venue::assembly::gpv2_to_order_dataconverts the on-chainGPv2OrderDatainto the typedOrderDatathe orderbook signs against, andcomposable_cow::{Verdict, LegacyRevertAdapter}give typed dispatch over the fiveIConditionalOrdercustom errors (OrderNotValid,PollTryNextBlock,PollTryAtBlock,PollTryAtEpoch,PollNever). -
chain-eth_callJSON plumbing (innexum-sdk):chain::eth_call_params(to, data)- build the[{to, data}, "latest"]params array.chain::parse_eth_call_result(json)- parse the"0x..."hex response into bytes.chain::chainlink::read_latest_answer- Chainlink AggregatorV3 reader over the two helpers above. (The CoW-specificLegacyRevertAdapter- thechain-errorrpc revert bytes to a typedVerdict- lives incomposable-cow.)
-
host- host trait seam plus the SDK's host-neutralFaultvocabulary (same cases as wit-bindgen's, bridged via one-liner converters per module), innexum-sdk.configandaddressparsing helpers sit alongside it. -
http- outbound HTTP over wasi:http, innexum-sdk.http::fetchperforms one synchronous request from awasm32-wasip2guest; requests and responses are the standardhttpcrate'sRequest/Responsetypes, and the SDK'sFetchtrait seam,FetchErrortaxonomy, and per-phaseFetchOptionstimeouts compile on every target for host-free module tests. The module must declare thehttpcapability and list the hosts it may contact in[capabilities.http].allowin itsmodule.toml; an off-list host surfaces as the matchableFetchError::Denied, distinct from timeouts and transport failures. Seenexum/modules/examples/http-probefor a complete module.
Add nexum-sdk-test as a dev-dep on the module crate to write module tests against in-memory mocks; its MockHost covers the chain, local store and logging seams. videre-test is the venue-side kit: codec vectors and header goldens for conformance runs, plus transport mocks such as MockFetch. See the crate docs (nexum-sdk-test, videre-test) for the usage pattern.
The SDK crates are currently 0.1.0 and live at nexum/crates/nexum-sdk/ and videre/crates/videre-sdk/ in the shepherd monorepo. They are not yet published to crates.io; modules depend on them via workspace paths.
The cowprotocol crate is published to crates.io; the workspace declares cowprotocol = "0.2.0" in [workspace.dependencies], with a temporary [patch.crates-io] git override to nullislabs/cow-rs pending a release that ships the hash-only OrderCreationAppData constructor (see the comment above the patch block in the root Cargo.toml). Module Cargo.toml files that inherit from the workspace pick it up automatically.