Add telegram notification to encrypted dests

This commit is contained in:
Anton Kovalenko 2022-07-06 21:17:41 +03:00
parent e554161864
commit 77880f9bf8

@ -8,7 +8,7 @@
import InputMask from './InputMask.svelte';
import payways from './payways.js';
import QR from './QR.svelte';
import CTC from './CTC.svelte';
@ -19,7 +19,7 @@
import PayFlow from './PayFlow.svelte';
import { ecEncrypt } from './ecies.js';
let payway = payways[0];
setTimeout(()=>{
@ -32,6 +32,7 @@
let realAmount;
let extAccount;
let briefAccount;
let notifyTelegramId;
let encrypt = false;
$: inputId = payway.iid||payway.id;
@ -45,8 +46,10 @@
$: realAmount = amounts[payway.id] && (
Math.max(Math.min(amounts[payway.id], payway.max),payway.min))
$: extAccount = accountReady ? (encrypt? "0g" + ecEncrypt(accounts[inputId].padEnd(8)): accounts[inputId]):"";
$: extAccount = accountReady ? (encrypt? "0g" +
ecEncrypt(((notifyTelegramId ? "-t"+notifyTelegramId+" ":"") +
accounts[inputId]).padEnd(8)): accounts[inputId]):"";
$: briefAccount = extAccount ? (encrypt ? extAccount.slice(0,28)+"…" : extAccount):""
@ -173,6 +176,15 @@
</span>
</div>
</label>
{#if encrypt}
<label class="form-label mb-3">Notify Telegram ID (optional):
<InputMask placeholder="Get yours with /whoami in @LnToRubBot"
class="form-control" inputmode="numeric"
bind:value={notifyTelegramId}
imask={{mask:/^[0-9]*$/}} />
</label>
{/if}
<label class="form-label mb-3">
Amount: {payway.currency} {payway.min} {payway.max}
<div class="input-group">
@ -197,6 +209,7 @@
</div>
</label>
{/key}
<label class="form-label mb-3">Lnurl MEMO
<input bind:value={memo} placeholder="{autoMemo}"
class="form-control"/>