Build inputs
Format every Leo literal with its type suffix. Preservefield, u16, u32, u64, u128, i32, bool, and address distinctions. Struct field order and names must match Leo.
Input records are supplied to the proving environment as decrypted record plaintext. Private scalar or field inputs, such as a blinding factor, must never be logged.
Prove and submit
The TypeScriptTransactionExecutor supports a fast devnode path and a proof-generating path. Production integrations should report proving progress separately from broadcast and confirmation.
At submission time, a locally valid proof can still fail finalization because public mappings changed after inputs were prepared. Common examples include a moved price, expired deadline, consumed record, changed pause state, or a new position boundary that invalidates insertion hints.
Confirm finalization
Do not treat a transaction ID as acceptance. Poll until the network reports accepted or rejected execution, then extract outputs from the accepted transition. Record outputs can be encrypted for different owners. A wallet should attempt decryption with the relevant view key and ignore investigator-owned records it cannot decrypt.Retry rules
Retries fall into three classes:- Same transaction: continue polling when status is unknown.
- Reprove with the same intent: rebuild deadline, quote, hints, records, and public state when the old transaction was rejected before consuming records.
- Do not retry automatically: policy rejection, pause, freeze, unsupported token, arithmetic boundary, or uncertain record-spend status.
Output discipline
Persist all decrypted outputs before advancing application state. Mint and position mutations return aPositionNFT. Funding operations can return token change. Claims and collections return token records. Losing an accepted output record can make user funds difficult to discover even though they remain on chain.
Finalizer warnings
Leo 4.3.4 warns about checks and effects afterFinal.run() in several paths. Integrators should not attempt to compensate for contract ordering in the client. Operators and auditors must decide whether the token-call and rollback semantics make each site acceptable for the target network and token implementations.