Contract Ledger
Contract Ledger: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.
This guide targets Agent Java SDK v0.3.0, Java 8+, and the tagged public contract. Examples run in a partner backend after initializing client in Quick Start.
Example prerequisites
The Java snippets share these imports. Initialize client using Quick Start and obtain platformUserId from the saved binding. Example user/order IDs must be replaced with your own persisted values.
listPerpetualLedger
Request model: PerpetualLedgerRequest.
Request fields
The example reads one page. For required fields, player scope, filter semantics, limit, cursor and bounded retries, follow Query overview. Keep all filters unchanged while paging; do not interpret an error as an empty result.
Contract ledger records
Interface: account/ledger. The returned data only contains the following 11 business fields and does not carry the order boolean flags.
Use the balance before and after the account change returned by the interface. Different changeType have different semantics, and it cannot be assumed that each amount is equal to walletBalanceAfter − walletBalanceBefore. The display/summary of ledger records should retain the type and detail identity.
Here’s an example of the format, using a fictitious ID and amount:
Example response envelope
This is an illustrative empty page, not a sample of a completed trade. Resource-specific field tables above describe populated items[].data.