9c55f1ebe2
* lnurlp paid action * lnurlp has 10% sybil fee * fix merge issue * Update pages/settings/index.js Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> * fix notifications * fix destructure * pass lud18Data to lnurlp action * minor cleanup * truncate invoice description to permitted length * remove redundant targetUserId * lnurlp paidAction -> receive paidAction * remove redundant user query * improve determining if peer is invoiceable * fix inconsistent relative imports * prevent paying self-proxied invoices and better held invoice cancellation * make gun/horse streak zap specific * unique withdrawal hash should apply to confirmed payments too * prevent receive from exceeding wallet limits * notifications * fix notifications & enhance invoice/withdrawl page * notification indicator, proxy receive based on threshold, refinements --------- Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: k00b <k00b@stacker.news>
22 lines
571 B
JavaScript
22 lines
571 B
JavaScript
import { nwcCall, supportedMethods } from '@/wallets/nwc'
|
|
export * from '@/wallets/nwc'
|
|
|
|
export async function testSendPayment ({ nwcUrl }, { logger }) {
|
|
const timeout = 15_000
|
|
|
|
const supported = await supportedMethods(nwcUrl, { logger, timeout })
|
|
if (!supported.includes('pay_invoice')) {
|
|
throw new Error('pay_invoice not supported')
|
|
}
|
|
}
|
|
|
|
export async function sendPayment (bolt11, { nwcUrl }, { logger }) {
|
|
const result = await nwcCall({
|
|
nwcUrl,
|
|
method: 'pay_invoice',
|
|
params: { invoice: bolt11 }
|
|
},
|
|
{ logger })
|
|
return result.preimage
|
|
}
|