mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
25 lines
808 B
TypeScript
25 lines
808 B
TypeScript
import {
|
|
InputTypeVariant,
|
|
parseInput,
|
|
withdrawLnurl
|
|
} from '@breeztech/react-native-breez-sdk'
|
|
|
|
const exampleLnurlWithdraw = async () => {
|
|
// ANCHOR: lnurl-withdraw
|
|
// Endpoint can also be of the form:
|
|
// lnurlw://domain.com/lnurl-withdraw?key=val
|
|
const lnurlWithdrawUrl =
|
|
'lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4exctthd96xserjv9mn7um9wdekjmmw843xxwpexdnxzen9vgunsvfexq6rvdecx93rgdmyxcuxverrvcursenpxvukzv3c8qunsdecx33nzwpnvg6ryc3hv93nzvecxgcxgwp3h33lxk'
|
|
|
|
const input = await parseInput(lnurlWithdrawUrl)
|
|
if (input.type === InputTypeVariant.LN_URL_WITHDRAW) {
|
|
const amountMsat = input.data.minWithdrawable
|
|
const lnUrlWithdrawResult = await withdrawLnurl({
|
|
data: input.data,
|
|
amountMsat,
|
|
description: 'comment'
|
|
})
|
|
}
|
|
// ANCHOR_END: lnurl-withdraw
|
|
}
|