Expand description
Order intents and their canonical byte representation.
The intent has two representations:
OrderIntentis the idiomatic Rust representation. Everything outside the settlement program uses it.EncodedOrderIntentis the canonical byte representation: the only thing sent on the wire and also the data encoding used to generate the order UID. There,kindandpartially_fillableshare a single flags byte.
Conversion is asymmetric: encoding an OrderIntent is infallible, but
decoding raw bytes returns Result and rejects a flags byte carrying a bit
the encoding doesn’t define.
Structs§
- Encoded
Order Intent - Canonical 213-byte representation of an
OrderIntent. The wire format and the order UID preimage. - Flags
- Collection of
OrderIntentfields that can be represented as a single bit. - Native
SolHas NoMint - Native SOL has no mint: it moves as lamports, not through a token program.
The error returned when a
TokenAssetnaming native SOL is converted to anAsset. - Order
Intent - Order intent. Its canonical encoding,
EncodedOrderIntent, is the exact wire format of create_order’sintentargument and the exact bytes hashed (SHA-256) to produce the order UID used in the order PDA’s seeds. - Token
Asset - The representation of the side of a trade involving an actual token.
Tokens from the mint
mintstored attoken_account.
Enums§
- Asset
- One side of a trade: what moves, and the account it moves through.
- Order
Kind - Direction of the trade. The discriminants are the values the
kindbit of the encoded flags byte takes.
Constants§
- ENCODED_
NATIVE_ SOL_ TRANSFER - The address an encoded intent carries as a mint to trade native SOL rather
than a token; see
Asset::Native.
Functions§
- check_
bytes - Given a slice of intent bytes, verify that it can encode a valid intent.
- hash_
bytes