List User Holdings
Returns the user's holdings: their purchases collapsed to one row per token. Each row carries the position at the root (totalquantity, totalamount, overall_profit, source) and the token it is in under token. Pending buys are left out, because a quantity that has not settled on chain is not owned yet. For the per-buy history, including buys still in progress, use List User Purchases.
List User Purchases
Returns the user's purchase history: one row per buy, newest first, across all markets. Each row carries its status, the transaction_id that drives it and the on-chain hash once it settles. Platform-token and secondary-market buys appear here as pending (status = 1) from the moment they are submitted. For one row per token with summed quantities, use List User Holdings.
Get Holding Count
Returns how many token positions the user currently holds: the number of the user's wallet–token balances with a remaining quantity above zero. A token held in two wallets counts twice; a token the user bought and sold in full does not count. Despite the path, this is not the number of purchases; count those with the total of List User Purchases.
Get Purchase Quantity
Returns how much of a token the user holds and the per-user holding cap of that token. Use it before a primary-market buy: Buy On Primary Market refuses a buy that would take the user's holding above maxallowedquantity.
Quote Primary Market Purchase
Prices a primary-market buy of quantity tokens without submitting it: the base amount, the buyer fee and the total the buyer is charged. Buy On Primary Market is asynchronous and answers with a transaction ID only, so this is how a caller shows the amount before it is spent. The fee is resolved and applied exactly as the buy does it, so the quote and the charge agree.
Quote Secondary Market Purchase
Prices a buy of quantity tokens from one secondary-market listing without submitting it. The price comes off the listing named by dealid, because two listings of the same token can sell at different prices. Both sides of the trade are reported: the buyer pays the buy-order fee on top of the listing amount (total), the seller pays the sell-order fee out of it (sellerproceeds). The fee is resolved and applied exactly as Buy On Secondary Market does it.
Buy On Primary Market
Buys quantity tokens from the issuer at the token's current price. The buy is asynchronous: it records a user transaction (type = 1, purchase on primary market) and answers with its transaction_id. Poll Get User Transaction until status is 3 (done) or 4 (error); the user owns the tokens only after 3. For a platform token the purchase also appears at once in List User Purchases with status = 1 (pending).
Buy On Secondary Market
Buys an open secondary-market listing (deal_id) from another user. A listing is bought whole: the contract takes only the deal ID and transfers the entire listing, so quantity must equal the listing's quantity (see List Token Listings); any other value is refused with 11004. The price is the listing's, and the buyer pays the buy-order fee on top; show the cost first with Quote Secondary Market Purchase.