Skip to content

Commit 97fd39c

Browse files
committed
fix lint errros
1 parent 5f2c844 commit 97fd39c

6 files changed

Lines changed: 35 additions & 14 deletions

File tree

src/functions/sendBitcoin/halfModalFunctions.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import handlePreSendPageParsing from "./handlePreSendPageParsing";
22
import getDataFromClipboard from "../getDataFromClipboard";
33
import QrScanner from "qr-scanner";
4+
import i18next from "i18next";
45

56
async function navigateToSendUsingClipboard() {
67
const response = await getDataFromClipboard();
@@ -29,10 +30,8 @@ async function navigateToSendUsingClipboard() {
2930
}
3031

3132
if (preParsingResponse.isExternalChain) {
32-
const { method, screen, params } = resolveExternalChainNavigation(
33-
preParsingResponse,
34-
from,
35-
);
33+
const { method, screen, params } =
34+
resolveExternalChainNavigation(preParsingResponse);
3635
return {
3736
didWork: true,
3837
params,
@@ -115,7 +114,7 @@ function formatStablecoinAmount(rawAmount, decimals = 2) {
115114
return value.toFixed(decimals);
116115
}
117116

118-
function resolveExternalChainNavigation(parsedResult, from) {
117+
function resolveExternalChainNavigation(parsedResult) {
119118
if (parsedResult.resolvedToken) {
120119
return {
121120
screen: "StablecoinSendScreen",

src/functions/sendBitcoin/processBolt11Invoice.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default async function processBolt11Invoice(input, context) {
108108
getFee: true,
109109
address: input.data.address,
110110
amountSats: amountSat,
111-
paymentType: !!input.data.usingSparkAddress ? "spark" : "lightning",
111+
paymentType: input.data.usingSparkAddress ? "spark" : "lightning",
112112
masterInfoObject,
113113
mnemonic: currentWalletMnemoinc,
114114
}),

src/functions/sendBitcoin/processLNUrlPay.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { MIN_USD_BTC_LIGHTNING_SWAP, SATSPERBITCOIN } from "../../constants";
33
import { getBolt11InvoiceForContact } from "../contacts";
44
import { isBlitzLNURLAddress } from "../lnurl";
55
import normalizeLNURLAddress from "../lnurl/normalizeLNURLAddress";
6-
import { dollarsToSats, getLightningPaymentQuote } from "../spark/flashnet";
6+
import {
7+
dollarsToSats,
8+
getLightningPaymentQuote,
9+
USD_ASSET_ADDRESS,
10+
} from "../spark/flashnet";
711
import { getLNAddressForLiquidPayment } from "./payments";
812
import { sparkPaymenWrapper } from "../spark/payments";
913

@@ -27,8 +31,7 @@ export default async function processLNUrlPay(input, context) {
2731
poolInfoRef,
2832
} = context;
2933

30-
const [username, domain] = input.data.address?.split("@");
31-
console.log(username, domain);
34+
const [username, domain] = input?.data?.address?.split("@") || [];
3235

3336
const nomralizedAddress = normalizeLNURLAddress(input.data.address);
3437
if (
@@ -192,7 +195,7 @@ export default async function processLNUrlPay(input, context) {
192195
getFee: true,
193196
address: invoice,
194197
amountSats: Number(enteredPaymentInfo.amount),
195-
paymentType: !!decoded.data.usingSparkAddress ? "spark" : "lightning",
198+
paymentType: decoded.data.usingSparkAddress ? "spark" : "lightning",
196199
masterInfoObject,
197200
mnemonic: currentWalletMnemoinc,
198201
}),

src/functions/spark/flashnet.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,3 +997,24 @@ export const getCurrentPrice = async (mnemonic, poolId) => {
997997
return { didWork: false, error: error.message };
998998
}
999999
};
1000+
1001+
/**
1002+
* Get refund txid from error message
1003+
* @param {string} error - The error to check
1004+
* @returns {txid|undefined} transaction id
1005+
*/
1006+
1007+
const getRefundTxidFromErrormessage = (message) => {
1008+
try {
1009+
const match = message.match(FLASHNET_REFUND_REGEX);
1010+
1011+
if (match) {
1012+
const transferID = match[1]; // first capture group
1013+
return transferID;
1014+
} else {
1015+
console.log("No transfer ID found");
1016+
}
1017+
} catch (err) {
1018+
console.log("error getting txid from error message", err);
1019+
}
1020+
};

src/functions/spark/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import {
2222
} from "../lrc20/cachedTokens";
2323
import Storage from "../localStorage";
2424
import { FlashnetClient } from "@flashnet/sdk";
25-
import { DEFAULT_PAYMENT_EXPIRY_SEC } from "../../constants";
25+
import { DEFAULT_PAYMENT_EXPIRY_SEC, USDB_TOKEN_ID } from "../../constants";
2626

2727
export let sparkWallet = {};
2828
export let flashnetClients = {};
@@ -570,8 +570,6 @@ export const querySparkHodlLightningPayments = async ({
570570
mnemonic,
571571
}) => {
572572
try {
573-
const runtime = await selectSparkRuntime(mnemonic);
574-
575573
const wallet = await getWallet(mnemonic);
576574
const response = await await wallet.queryHTLC({
577575
paymentHashes,

src/pages/contacts/utils/navigateToExpandedContact.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function useNavigateToContact() {
3838
toggleGlobalContactsInformation(
3939
{
4040
myProfile: { ...globalContactsInformation.myProfile },
41-
addedContacts: encriptMessage(
41+
addedContacts: await encryptMessage(
4242
contactsPrivateKey,
4343
publicKey,
4444
JSON.stringify(newAddedContacts),

0 commit comments

Comments
 (0)