diff --git a/app/appTest.tsx b/app/appTest.tsx deleted file mode 100644 index 384ca37511..0000000000 --- a/app/appTest.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import React from "react" -import { View } from "react-native" -import "node-libs-react-native/globals" // needed for Buffer? - -import { - connect, - defaultConfig, - getInfo, - LiquidNetwork, - listPayments, - prepareReceivePayment, - prepareSendPayment, - receivePayment, - sendPayment, -} from "@breeztech/react-native-breez-sdk-liquid" -import * as bip39 from "bip39" -const appTest = () => { - React.useEffect(() => { - let bolt11Invoice = null - - const asyncFn = async () => { - try { - // Get the mnemonic - console.log("$$$$$$$$$$$$$$$$$$$") - const mnemonic = bip39.generateMnemonic(128) - console.log(">>>>>>>>>???????>????????>????????", mnemonic) - // Connect using the config - const config = await defaultConfig(LiquidNetwork.MAINNET) - console.log(">>>>>>>>>>>>>>>", config) - await connect({ config, mnemonic }) - - // Get wallet info - let getInfoRes = await getInfo() - console.log("???????????????", getInfoRes) - // Historical payments list - let payments = listPayments({}) - - /* Receive lightning payment */ - - let prepareReceiveRes = await prepareReceivePayment({ payerAmountSat: 1000 }) - - // Get the fees required for this payment - - let receivePaymentRes = await receivePayment({ prepareRes: prepareReceiveRes }) - - // Wait for payer to pay.... once successfully paid an event of `paymentSucceeded` will be emitted. - - /* Send lightning payment */ - - // Set the `bolt11Invoice` to enable sending in the example app - if (bolt11Invoice) { - let prepareSendRes = await prepareSendPayment({ invoice: bolt11Invoice }) - - // Get the fees required for this payment - - let sendPaymentRes = await sendPayment(prepareSendRes) - - // Once successfully paid an event of `paymentSucceeded` will be emitted. - } - } catch (e) { - console.log(`Error: ${e}`) - } - } - - asyncFn() - }, []) - - return -} - -export default appTest diff --git a/app/components/modal-nfc/modal-nfc.tsx b/app/components/modal-nfc/modal-nfc.tsx index 0a604727c7..d7c5369697 100644 --- a/app/components/modal-nfc/modal-nfc.tsx +++ b/app/components/modal-nfc/modal-nfc.tsx @@ -30,6 +30,7 @@ import { LnUrlPayResultVariant, lnurlPay, parse, + prepareLnurlPay, } from "@breeztech/react-native-breez-sdk-liquid" export const ModalNfc: React.FC<{ @@ -180,16 +181,14 @@ export const ModalNfc: React.FC<{ try { const input = await parse(lnurl) if (input.type === InputTypeVariant.LN_URL_PAY) { - const amountMsat = input.data.minSendable - const optionalComment = "" - const optionalPaymentLabel = "