Skip to main content

Module compact_types

Module compact_types 

Source
Expand description

Typed wrappers + named shapes returned by the Rust source emitted by moonproof-codegen. Mirrors compactc’s compact-types.ts type SET; the projection from atom buffers happens through crate::walker (single source of truth across every binding language).

These live in moonproof-runtime so generated code, library code, and downstream consumers all reach for the same type — there’s no per-language duplicate.

Structs§

CompactList
Typed wrapper over a List<T> snapshot.
CompactMap
Typed wrapper over a Map<K, V> ledger snapshot.
CompactSet
Typed wrapper over a Set<T> snapshot.
ContractAddress
Contract-address wrapper (the descriptor-projection shape; distinct from moonproof_ledger::coin_structure::contract::ContractAddress).
Curve25519Point
Point on Curve25519 in twisted-Edwards form. x and y are little-endian 32-byte values in the Curve25519 base field. Unlike the secp curves there is no identity flag: the identity is the ordinary point (0, 1).
JubjubPoint
Point in the embedded elliptic curve. Field elements are little- endian 32-byte BLS-scalar repr.
MerkleTreeDigest
Hash value of a Merkle tree.
MerkleTreePath
Path demonstrating inclusion in a Merkle tree.
MerkleTreePathEntry
Entry in a Merkle path.
OwnerEither
Canonical OpenZeppelin Either<ZswapCoinPublicKey, ContractAddress> shape.
QualifiedShieldedCoinInfo
Qualified shielded coin descriptor (coin + Merkle tree index).
Recipient
Recipient of a coin produced by a circuit.
Secp256k1Point
Point on secp256k1. x and y are little-endian 32-byte values in the secp256k1 base field; identity flags the point at infinity, which has no coordinate representation.
Secp256r1Point
Point on secp256r1 (P-256), laid out as Secp256k1Point: x and y little-endian in the secp256r1 base field, identity flagging the point at infinity.
ShieldedCoinInfo
Shielded coin descriptor.
ShieldedCoinRecipient
Shielded-coin recipient.
UserAddress
Unshielded user-address wrapper.
ZswapCoinPublicKey
Coin public-key wrapper.

Functions§

decode_array
Decode a RuntimeValue::Array of exact length N into [T; N].
decode_contract_address
Decode a contract address from either { "bytes": Bytes(32) } or raw Bytes(32).
encode_array
Encode a fixed-size array into a RuntimeValue::Array.
encode_contract_address
Encode a 32-byte contract address as { "bytes": Bytes(...) }.
expect_object
Extract the field map of a RuntimeValue::Object or report a typed error.
expect_string
Extract a string from a RuntimeValue::String or report a typed error.
take_field
Remove and project a typed field from an object map.
take_raw_field
Remove a raw field from an object map or report a missing-field error.
unknown_variant
Construct an unknown-variant error for an enum projection.