Compare commits
No commits in common. "8663e85c5c8329ae64f9080f342435aadef4e0bc" and "c1c010f24cc66496b6514cd1c704e90380a7647b" have entirely different histories.
8663e85c5c
...
c1c010f24c
@ -55,9 +55,6 @@
|
||||
$: autoMemo = genAutoMemo(payway,
|
||||
accountComplete && accounts[inputId],
|
||||
realAmount)
|
||||
let lightningAddress;
|
||||
$: lightningAddress = accountComplete ?
|
||||
genAddress(payway, accounts[inputId], realAmount):""
|
||||
|
||||
function lnurlEncode(url) {
|
||||
return bech32.encode("LNURL",
|
||||
@ -69,16 +66,6 @@
|
||||
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
|
||||
}).join('')
|
||||
}
|
||||
function genAddress(payway,account,amount) {
|
||||
if (!account || !payway)
|
||||
return ""
|
||||
const prefix = amount?
|
||||
((amount == Math.floor(amount)? ""+amount:
|
||||
amount.toFixed(2))+payway.currency.toLowerCase()+"-"):""
|
||||
if (account[0]=='+')
|
||||
account=account.slice(1)
|
||||
return prefix + account + "@" + payway.id + ".lnurl-pay.me"
|
||||
}
|
||||
|
||||
function genLNURL(payway,account,amount,memo) {
|
||||
let params = new URLSearchParams();
|
||||
@ -176,6 +163,7 @@
|
||||
<input bind:value={memo} placeholder="{autoMemo}"
|
||||
class="form-control"/>
|
||||
</label>
|
||||
|
||||
</SiteCard>
|
||||
<SiteCard>
|
||||
{#if lnurl}
|
||||
@ -189,56 +177,45 @@
|
||||
<div class="form-text mb-2 mt-2">Expecting: {payway.acc.toLowerCase()}</div>
|
||||
{/if}
|
||||
<div class="d-flex justify-content-center align-items-stretch m-2"
|
||||
class:invisible={!lnurl}>
|
||||
<!-- {#key lnurl} -->
|
||||
<a href="lightning:{lnurl}">
|
||||
<QR value={lnurl} size="{230}" />
|
||||
</a>
|
||||
<!-- {/key} -->
|
||||
</div>
|
||||
<div class="btn-group flex-wrap mt-auto mb-2"
|
||||
role="group" class:invisible={!lnurl}>
|
||||
<CTC let:id let:action text={lnurl}>
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
id={id} on:click={action}>Copy</button>
|
||||
</CTC>
|
||||
{#if canShare}
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
on:click={()=>{ navigator.share({text:lnurl})}}>Share
|
||||
</button>
|
||||
{/if}
|
||||
<Tipped let:id>
|
||||
<a slot="thing" role="button" class="btn btn-outline-secondary"
|
||||
href="lightning:{lnurl}" {id}>Pay</a>
|
||||
<div slot="tip">open in your wallet</div>
|
||||
</Tipped>
|
||||
class:invisible={!lnurl}>
|
||||
<!-- {#key lnurl} -->
|
||||
<a href="lightning:{lnurl}">
|
||||
<QR value={lnurl} size="{230}" />
|
||||
</a>
|
||||
<!-- {/key} -->
|
||||
</div>
|
||||
|
||||
<Tipped let:id>
|
||||
<button slot="thing" {id} type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
on:click="{()=>getInvoiceFor=lnurl}">
|
||||
Invoice</button>
|
||||
<div slot="tip">get an invoice for wallets with no lnurl-pay</div>
|
||||
</Tipped>
|
||||
</div>
|
||||
|
||||
{#if lightningAddress}
|
||||
<CTC let:id let:action force text={lightningAddress}}>
|
||||
<div class="input-group mt-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<a href="https://lightningaddress.com/">Lightning address:</a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="user-select-all form-control"
|
||||
style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis"
|
||||
on:click={action} id={id}>{lightningAddress}
|
||||
</div>
|
||||
</div>
|
||||
</CTC>
|
||||
{/if}
|
||||
<div class="d-flex justify-content-center align-items-stretch"
|
||||
class:invisible={!lnurl}>
|
||||
<p class="form-text">You might want to save image and share it
|
||||
as you like. All form data are present in lnurl: don't share what you wanted to hide.</p>
|
||||
</div>
|
||||
|
||||
<div class="btn-group flex-wrap mt-auto mb-2"
|
||||
role="group" class:invisible={!lnurl}>
|
||||
<CTC let:id let:action text={lnurl}>
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
id={id} on:click={action}>Copy</button>
|
||||
</CTC>
|
||||
{#if canShare}
|
||||
<button type="button" class="btn btn-outline-secondary"
|
||||
on:click={()=>{ navigator.share({text:lnurl})}}>Share
|
||||
</button>
|
||||
{/if}
|
||||
<Tipped let:id>
|
||||
<a slot="thing" role="button" class="btn btn-outline-secondary"
|
||||
href="lightning:{lnurl}" {id}>Pay</a>
|
||||
<div slot="tip">open in your wallet</div>
|
||||
</Tipped>
|
||||
|
||||
<Tipped let:id>
|
||||
<button slot="thing" {id} type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
on:click="{()=>getInvoiceFor=lnurl}">
|
||||
Invoice</button>
|
||||
<div slot="tip">get an invoice for wallets with no lnurl-pay</div>
|
||||
</Tipped>
|
||||
</div>
|
||||
</SiteCard>
|
||||
</SiteDeck>
|
||||
|
||||
|
@ -77,7 +77,7 @@ export default [
|
||||
{"name":"💳 🇺🇦 UAH ₴ Visa/MC",
|
||||
"currency":"UAH",
|
||||
"min":10,
|
||||
"max":20000,
|
||||
"max":5000,
|
||||
"imask":masks.cc,
|
||||
"iid":"cc",
|
||||
"acc":"Card number",
|
||||
|
Loading…
Reference in New Issue
Block a user