aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/features/names.js25
-rw-r--r--src/i18n.js6
2 files changed, 31 insertions, 0 deletions
diff --git a/src/features/names.js b/src/features/names.js
index bd4ab4d..dc3426e 100644
--- a/src/features/names.js
+++ b/src/features/names.js
@@ -437,6 +437,10 @@ export function namesFeature(ctx) {
copyBtn(code, t('namesZapCodeCopy'))) : null;
})(),
h('details', { class: 'small faint' },
+ h('summary', {}, t('namesPos')),
+ h('p', { style: 'margin:4px 0' }, t('namesPosHow')),
+ posSection(st)),
+ h('details', { class: 'small faint' },
h('summary', {}, t('namesOwnNode')),
h('p', { style: 'margin:4px 0' }, t('namesOwnNodeMenuHow')),
ownNodeSection()),
@@ -452,6 +456,27 @@ export function namesFeature(ctx) {
claimForm(false));
}
+ // A coinos POS terminal (coinos-pos) takes payments to this name with a
+ // bearer token the registrar mints for the owner: the terminal can ring up
+ // sales and see them settle, never spend. Shown once, never stored — the
+ // token goes straight into the terminal's config at coinos.io/pos.
+ function posSection(st) {
+ const tok = ui.posToken;
+ const body = () => ({ name: st.name, domain: st.domain || DOMAIN() });
+ return h('div', { class: 'col', style: 'gap:6px' },
+ tok ? h('div', { class: 'addr-box break', style: 'font-size:10px' }, tok) : null,
+ h('div', { class: 'row gap6', style: 'flex-wrap:wrap' },
+ h('button', { class: 'btn-ghost btn-sm', onClick: async () => {
+ try { ui.posToken = (await post('/pos/token', 'POST', body())).token; render(); }
+ catch (e) { toast(e.message); }
+ } }, t('namesPosCreate')),
+ tok ? copyBtn(tok, t('namesPosCopy')) : null,
+ h('button', { class: 'btn-ghost btn-sm', onClick: async () => {
+ try { await post('/pos/token', 'DELETE', body()); ui.posToken = null; toast(t('namesPosRevoked')); render(); }
+ catch (e) { toast(e.message); }
+ } }, t('namesPosRevoke'))));
+ }
+
// The Receive tab's default pane: your name, big and scannable.
function namePane(seg) {
const st = load();
diff --git a/src/i18n.js b/src/i18n.js
index 1885d88..1b74c00 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -732,6 +732,12 @@ const STR = {
receiveNameTab: 'Spending',
namesCustom: 'Change username',
namesCustomHow: 'Pick a new name for your payment address. Your old address stops working.',
+ namesPos: 'Point of sale',
+ namesPosHow: 'A coinos POS terminal takes payments to this address. Create a token and enter it as the API token when you flash the terminal at coinos.io/pos. The terminal can ring up sales and see them paid; it can never spend.',
+ namesPosCreate: 'Create POS token',
+ namesPosCopy: 'Copy token',
+ namesPosRevoke: 'Revoke tokens',
+ namesPosRevoked: 'POS tokens revoked',
namesDesc: 'Claim your payment address — like [email protected]. People can pay you just by typing it, no codes to copy or QR to scan.',
namesPlaceholder: 'username',
namesResolving: 'Looking up {name}…',