Users & Assets
Users & Assets: 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.
User ID Rules
platformUserId is the 6MM external user ID. It is currently a 10-digit numeric
string, for example:
Rules:
- Store it as a string, not as an integer.
- Do not generate, decode, or infer meaning from it.
- Use your own partner-side user ID as
agentUserId. - Persist the relationship among
agentUserId,platformUserId, andagentOrderNo.
Bind User
Bind creates or fetches the relationship between a partner user and a 6MM platform user. Call it when a user first enters the trading flow or before the first transfer into 6MM.
Request fields:
Response fields:
Query Partner Account
When currency is absent, the SDK uses defaultCurrency.
Query User Assets
Fields:
Distinguish the three wallets
queryAccount Query the merchant platform margin account, not the merchant user wallet. This interface does not have environment parameters and cannot be queried as a simulated user asset.
Query the two platform wallets of simulated users:
Interface: POST /v1/agent/query-user-assets. Funding is requested only when includeFunding=true; the original contract asset query semantics are used by default.
Amounts are handled as strings or BigDecimal, not float/double.