Match the field list of spec section 7.3 exactly

This commit is contained in:
ai-bot committed 2026-11-15 11:23:51 +00:00
1 parent 093b17d9f8
commit 8f345127e8
1 file changed
+18 -8
+18 -8
View File
@@ -8,13 +8,14 @@
(function () {
"use strict";
/* What each type shows. Currencies not listed are hidden and fixed; `market`
and `fee` say whether those two sections belong to the type (docs/spec.md
sections 3.2 and 7.3). */
/* What each type shows, exactly the list of docs/spec.md section 7.3. A slot
with one currency shows that unit as plain text; `default` is the currency a
slot with a choice opens with. `market` and `fee` say whether those two
sections belong to the type. */
var TYPE_FIELDS = {
trade: {
in: {label: "Kjøp", currencies: ["sats", "nok"]},
out: {label: "Salg/kostnad", currencies: ["sats", "nok"]},
in: {label: "Kjøp", currencies: ["sats", "nok"], default: "sats"},
out: {label: "Salg/kostnad", currencies: ["sats", "nok"], default: "nok"},
consumes: true,
market: true,
fee: true
@@ -35,7 +36,7 @@
},
loss: {
out: {label: "Tap", currencies: ["sats"]},
value: {label: "Pris", optional: true},
value: {label: "Pris"},
consumes: true,
market: true,
fee: true
@@ -47,6 +48,12 @@
market: true,
fee: true
},
transfer_in: {
in: {label: "Motteke", currencies: ["sats"]},
consumes: false,
market: true,
fee: false
},
gift_received: {
in: {label: "Motteke gåve", currencies: ["sats"]},
value: {label: "Pris"},
@@ -61,15 +68,18 @@
fee: true
},
admin_cost: {
out: {label: "Kostnad", currencies: ["sats"]},
out: {label: "Kostnad", currencies: ["nok"]},
consumes: false,
market: false,
fee: false
}
};
/* What the owner sees for a currency: sats and whole kroner (section 2). */
var UNIT_LABELS = {sats: "sats", nok: "kr"};
/* Types where a sats fee is taken on top of the amount given away, §3.2. */
var FEE_TAKEN_ON_TOP = ["trade", "spend"];
var FEE_TAKEN_ON_TOP = ["trade", "spend", "transfer_out"];
var form = document.querySelector("[data-form]");
var title = document.querySelector("[data-title]");