Module iota_primitives

Module iota_primitives 

Source
Expand description

JSON Schema adapter types for the IOTA JSON-RPC surface, applied at field sites via #[serde_as(as = "...")]. Core serde behaviour lives in iota_types::iota_serde; this module adds the schemars::JsonSchema layer on top (the iota-types crate intentionally has no schemars dependency).

To add a new adapter, prefer a unit marker struct with a manual JsonSchema impl for explicit control over description, format, and shape. If custom serialisation is needed, delegate SerializeAs / DeserializeAs to the corresponding adapter in iota_types::iota_serde so the two crates cannot drift. 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.
GenericSignature
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].
IotaAddress
A schema type that defines the JSON representation of the IotaAddress type.
ObjectID
A schema type that defines the JSON representation of the ObjectID type.
ProtocolVersion
A schema type that defines the JSON representation of the ProtocolVersion type as a string and provides an alternate serialization usable via #[serde_as].
SequenceNumberString
A schema type that defines the JSON representation of the SequenceNumber type as a string and provides an alternate serialization usable via #[serde_as].
SequenceNumberU64
A schema type that defines the JSON representation of the SequenceNumber type as a u64 integer and uses the default serialization.
StructTag
A schema type that defines the JSON representation of a Move StructTag as a string, and provides a string serialization usable via #[serde_as].
TypeTag
A schema type that defines the JSON representation of a Move TypeTag as a string, and provides a string serialization usable via #[serde_as].