Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeKaufman committed Oct 4, 2024
1 parent 6574756 commit 7cfb04a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 36 deletions.
34 changes: 11 additions & 23 deletions app/components/admin/homeComponents/fundGift/amountToGift.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import {useNavigation, useTheme} from '@react-navigation/native';
import {
ActivityIndicator,
Alert,
Image,
Keyboard,
KeyboardAvoidingView,
Platform,
SafeAreaView,
ScrollView,
Share,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
TouchableWithoutFeedback,
View,
useWindowDimensions,
} from 'react-native';
Expand All @@ -30,13 +25,7 @@ import {
} from '../../../../constants';
import {useGlobalContextProvider} from '../../../../../context-store/context';
import {useEffect, useRef, useState} from 'react';
import {
copyToClipboard,
formatBalanceAmount,
getLocalStorageItem,
numberConverter,
setLocalStorageItem,
} from '../../../../functions';
import {copyToClipboard, formatBalanceAmount} from '../../../../functions';
import {getFiatRates} from '../../../../functions/SDK';
import {sendSpontaneousPayment} from '@breeztech/react-native-breez-sdk';
import {ConfigurePushNotifications} from '../../../../hooks/setNotifications';
Expand Down Expand Up @@ -461,21 +450,21 @@ export default function AmountToGift() {

return;

const data = `https://blitz-wallet.com/.netlify/functions/lnurlwithdrawl?platform=${
Platform.OS
}&token=${expoPushToken?.data}&amount=${giftAmount}&uuid=${UUID}&desc=${
LNURL_WITHDRAWL_CODES[0]
}&totalAmount=${1}`;
// const data = `https://blitz-wallet.com/.netlify/functions/lnurlwithdrawl?platform=${
// Platform.OS
// }&token=${expoPushToken?.data}&amount=${giftAmount}&uuid=${UUID}&desc=${
// LNURL_WITHDRAWL_CODES[0]
// }&totalAmount=${1}`;

const byteArr = Buffer.Buffer.from(data, 'utf8');
// const byteArr = Buffer.Buffer.from(data, 'utf8');

const words = bench32.bech32.toWords(byteArr);
// const words = bench32.bech32.toWords(byteArr);

const encoded = bench32.bech32.encode('lnurl', words, 1500);
// const encoded = bench32.bech32.encode('lnurl', words, 1500);

const withdrawLNURL = encoded.toUpperCase();
// const withdrawLNURL = encoded.toUpperCase();

return withdrawLNURL;
// return withdrawLNURL;
} catch (err) {
return false;
console.log(err);
Expand Down Expand Up @@ -608,7 +597,6 @@ const styles = StyleSheet.create({
borderRadius: 8,
marginTop: 50,
},
buttonText: {color: COLORS.white, fontFamily: FONT.Other_Regular},

buttonsContainer: {
flexDirection: 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {CENTER, ICONS} from '../../../../../constants';
import {useEffect, useState} from 'react';
import {copyToClipboard, getLocalStorageItem} from '../../../../../functions';
import FullLoadingScreen from '../../../../../functions/CustomElements/loadingScreen';
import {Buffer} from 'buffer';

export default function HistoricalOnChainPayments() {
const navigate = useNavigation();
Expand Down
1 change: 1 addition & 0 deletions app/functions/boltz/LNtoLiquidSwap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import crypto from 'react-native-quick-crypto';

import {getBoltzApiUrl} from './boltzEndpoitns';
import {createLiquidReceiveAddress} from '../liquidWallet';
import {Buffer} from 'buffer';

export default async function createLNToLiquidSwap(
swapAmountSats,
Expand Down
2 changes: 2 additions & 0 deletions app/functions/boltz/createKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {retrieveData, storeData} from '../secureStore';
import {getRandomBytes} from 'expo-crypto';
import {networks as liquidNetworks} from 'liquidjs-lib';

import {Buffer} from 'buffer';

const ECPair = ECPairFactory(ecc);

export async function createBoltzSwapKeys() {
Expand Down
1 change: 1 addition & 0 deletions app/functions/boltz/handle-webview-claim-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios from 'axios';
import {getBoltzApiUrl} from './boltzEndpoitns';
import {getLocalStorageItem, setLocalStorageItem} from '../localStorage';
import {Notifications} from 'react-native-notifications';
import {Buffer} from 'buffer';

export default function handleWebviewClaimMessage(
navigate,
Expand Down
2 changes: 1 addition & 1 deletion app/functions/boltz/liquidToLNSwap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {getBoltzApiUrl} from './boltzEndpoitns';
export default async function createLiquidToLNSwap(invoice) {
try {
const pairSwapInfo = await getBoltzSwapPairInformation('liquid-ln');
if (!pairSwapInfo) new Error('no swap info');
if (!pairSwapInfo) throw Error('no swap info');

const {privateKeyString, keys, publicKey} = await createBoltzSwapKeys();

Expand Down
6 changes: 1 addition & 5 deletions app/functions/boltz/magicRoutingHints.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ import * as bip21 from 'bip21';
import {assetIDS} from '../liquidWallet/assetIDS';

const ECPair = ECPairFactory(ecc);

const endpoint = 'https://api.testnet.boltz.exchange';
import {Buffer} from 'buffer';

const magicRoutingHintConstant = '0846c900051c0000';
const lbtcAssetHash =
'144c654344aa716d6f3abcc1ca90e5641e4e2a7f633bc09fe3baf64585819a49';
// 6f0279e9ed041c3d710a9f57d0c02928416460c4b722ae3457a11eec381c526d

const findMagicRoutingHint = invoice => {
const decodedInvoice = bolt11.decode(invoice);
Expand Down
6 changes: 1 addition & 5 deletions app/screens/inAccount/sendBtcPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,7 @@ const styles = StyleSheet.create({
height: 250,
borderWidth: 3,
},
qrLine: {
width: '100%',
height: 10,
position: 'absolute',
},

qrVerticalBackground: {
width: 250,
flexDirection: 'row',
Expand Down
1 change: 1 addition & 0 deletions db/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {btoa} from 'react-native-quick-base64';
import crypto from 'react-native-quick-crypto';
import {nip06} from 'nostr-tools';
import {removeLocalStorageItem} from '../app/functions/localStorage';
import {Buffer} from 'buffer';

// Optionally import the services that you want to use
// import {...} from "firebase/auth";
Expand Down
1 change: 0 additions & 1 deletion navigation/tabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ function MyTabBar({state, descriptors, navigation}) {
? COLORS.lightsOutBackgroundOffset
: COLORS.darkModeBackgroundOffset
: COLORS.lightModeBackgroundOffset,
left: (useWindowDimensions().width * 0.001) / 2,
height: 50,
position: 'absolute',
left: 0,
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"extends": "@react-native/typescript-config/tsconfig.json"
"extends": "@react-native/typescript-config/tsconfig.json",
// "compilerOptions": {
// "module": "es2020" // or 'esnext', 'node16', etc.
// // other options...
// }
"compilerOptions": {
"jsx": "react-jsx"
}
}

0 comments on commit 7cfb04a

Please sign in to comment.