Class ContractSpec

java.lang.Object
org.stellar.sdk.contract.ContractSpec

public final class ContractSpec extends Object
Represents a SEP-0048 contract interface specification.

Entries are stored in module order and exposed as an unmodifiable list. The classified views (getFunctions(), getEvents(), etc.) are derived from getEntries() on each call. Construct with raw SCSpecEntry values, decode from contract Wasm bytes via fromWasm(byte[]), or decode from a SEP-0048 XDR stream via fromXdrBytes(byte[]).

SEP-0048 does not require entry names to be unique, so the getFunction/ getEvent/getUdt lookups return the first matching entry in module order.

This wrapper is shallow immutable: the entry list cannot be modified, but the contained SCSpecEntry objects are the underlying mutable XDR types. Do not mutate them after construction; doing so also affects equals(Object), hashCode(), and the classified views.

See Also: