Справочник функций
GameMaker Studio · GML · Currency & store
gmda_getLedger
Fetches recent currency ledger entries for this player, newest first.
Asynchronous (result via event)
Signature
gmda_getLedger([limit=50], [offset=0]) -> realWhat it does
GETs /currency/ledger?limit&offset with the session headers (limit and offset travel in the query string). The queued ledger_loaded event carries response, whose entries array holds the transaction rows newest first, each with the currency, the signed delta, the resulting balance and the operation type. Returns 1 once dispatched, or 0 when there is no active session.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| limit | real | 50 | How many entries to return; clamped to 1..200. |
| offset | real | 0 | How many entries to skip, for paging; floored at 0. |
How to call it
Call gmda_getLedger(), then read the ledger_loaded event with gmda_pollEvent(). Pass limit and offset to page through older history.
Result event: ledger_loaded { success, response }
Example
gmda_getLedger();
// in the Step event, drain the queue:
var e = gmda_pollEvent();
while (!is_undefined(e)) {
if (e.event == "ledger_loaded" && e.success) {
var rows = e.response.entries;
for (var i = 0; i < array_length(rows); i++) {
show_debug_message(string(rows[i].op_type) + " " + string(rows[i].delta));
}
}
e = gmda_pollEvent();
}Use cases
- Show a transaction history of grants, purchases, and top-ups.
- Page through older currency movements with limit and offset.