Skip to main content

Module codec

Module codec 

Source
Expand description

Call argument and return-value codecs for contract specs and local source metadata.

Structs§

ContractMetadata
Locally parsed method metadata recovered from project source files.
DecodedAbort
A contract abort payload decoded through exception metadata.
MethodMetadata
Local argument and return type names parsed from a Rust method signature.
SpecMethodMetadata
Contract spec metadata for one resolved contract method.

Enums§

AbortDecodeError
Why an abort buffer could not be decoded into an exception value.
CallMetadata
Type metadata used to encode arguments and decode return values.
Error
Contract metadata, argument encoding, or value decoding failed.

Functions§

build_type_def_index
Build an index of named embedded type definitions.
decode_abort
Decode an abort buffer ([selector][payload]) into the exception it carries.
decode_abort_payload
Decode a payload against caller-supplied exception and type definitions.
decode_event_spec_value_from_reader
Decode one event value while rejecting enum discriminants absent from the spec.
decode_return
Decode contract return bytes into JSON using the resolved metadata when available.
decode_spec_value
Decode one top-level contract spec value from a byte slice.
decode_spec_value_from_reader
Decode one contract spec value from the current XDR reader position.
encode_args
Encode argument strings into contract calldata using the resolved metadata.
format_contract_address
Format a contract address as unprefixed, case-sensitive base58.
is_erc20_too_large
method_entrypoint_id
Derive the canonical method selector from interface identity and method name.
normalize_type_name
Normalize supported Rust syntax from locally parsed type names.
parse_contract_address
Parse a Z StrKey or base58 contract address, including in typed calldata.
resolve_spec_method
Resolve a method from a supplied spec, rejecting ambiguous interface matches. Returns None when the method is absent; does not read files or discover projects.
spec_id_text
Render a spec id for a diagnostic, validating every segment.
spec_string_text
Decode a spec string as UTF-8 text and validate it as a safe identifier.

Type Aliases§

TypeDefIndex
Named contract type definitions keyed by contract type name.