Skip to content

Commit

Permalink
disable linting for one line in balances
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jul 13, 2023
1 parent ecc2ab5 commit a54797c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion tasks/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ const fetchBalances = async (
const zeta = await fetchZetaBalance(address, provider, networkName);
const isZeta = networkName === "zeta_testnet";
const zrc20 = isZeta ? { zrc20: await fetchZRC20Balance(address) } : {};
return { native, networkName, zeta, ...zrc20 };
/* eslint-disable */
return { networkName, native, zeta, ...zrc20 };
/* eslint-enable */
} catch (error) {}
};

Expand Down
5 changes: 3 additions & 2 deletions tasks/sendBTC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ const makeTransaction = async (
amount: any,
utxos: any,
address: string,
memo: string = ""
m: string = ""
) => {
const API = getEndpoints("esplora", "btc_testnet")[0].url;
const TESTNET = bitcoin.networks.testnet;
const memo = Buffer.from(m, "hex");

if (memo.length >= 78) throw new Error("Memo too long");
utxos.sort((a: any, b: any) => a.value - b.value); // sort by value, ascending
Expand Down Expand Up @@ -69,7 +70,7 @@ const makeTransaction = async (
const psbt = new bitcoin.Psbt({ network: TESTNET });
psbt.addOutput({ address: to, value: amount });
if (memo.length > 0) {
const embed = bitcoin.payments.embed({ data: [Buffer.from(memo, "hex")] });
const embed = bitcoin.payments.embed({ data: [memo] });
if (!embed.output) throw new Error("Unable to embed memo");
psbt.addOutput({ script: embed.output, value: 0 });
}
Expand Down

0 comments on commit a54797c

Please sign in to comment.