Expand description
JSON Schema and serialization adapter types for the IOTA JSON-RPC surface,
applied at field sites via #[schemars(with = "...")] and
#[serde_as(as = "...")]. Each adapter owns both the schemars::JsonSchema
layer and the JSON serialization for its type, so the JSON-RPC wire format
is defined in this crate rather than relying on the serde impls of the
external iota-sdk-types crate.
To add a new adapter, prefer a unit marker struct with a manual JsonSchema
impl (for explicit control over description, format, and shape) plus
SerializeAs / DeserializeAs impls for the target type(s). String-like
types reuse serde_with::DisplayFromStr so the format matches the type’s
Display/FromStr; byte payloads reuse the fastcrypto encoders. The Move
tag adapters reuse the shared, IOTA-specific formatting/parsing helpers from
iota_types (which many other crates depend on) rather than duplicating
that logic. Newtype wrappers (e.g. SequenceNumberString(u64)) are only
appropriate when the wrapper itself is the serialised value.
Structs§
- Base58
- A schema type that defines the JSON representation of a Base58 encoded string. A custom JsonSchema impl is necessary to add the “base58” format to the schema.
- Base64
- A schema type that defines the JSON representation of a Base64 encoded string. A custom JsonSchema impl is necessary to add the “base64” format to the schema.
- Generic
Signature - A schema type that defines the JSON representation of a Base64 encoded signature.
- Identifier
- A schema type that defines the JSON representation of a Move identifier,
and provides a string serialization usable via
#[serde_as]. - Iota
Address - A schema type that defines the JSON representation of the
IotaAddresstype. - Object
Id - A schema type that defines the JSON representation of the
ObjectIdtype. - Protocol
Version - A schema type that defines the JSON representation of the
ProtocolVersiontype as a string and provides an alternate serialization usable via#[serde_as]. - Sequence
Number String - A schema type that defines the JSON representation of the
[
SequenceNumber] type as a string and provides an alternate serialization usable via#[serde_as]. - Sequence
Number U64 - A schema type that defines the JSON representation of the
[
SequenceNumber] type as a u64 integer and uses the default serialization. - Struct
Tag - A schema type that defines the JSON representation of a Move
StructTagas a string, and provides a string serialization usable via#[serde_as]. - TypeTag
- A schema type that defines the JSON representation of a Move
TypeTagas a string, and provides a string serialization usable via#[serde_as].