Skip to content

Commit

Permalink
arrow functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jul 10, 2023
1 parent e35a1ea commit c93fee5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tasks/sendBTC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ const decodeTransaction = async (tx: any) => {
return await p1.json();
};

async function fetchUtxos(address: string): Promise<UTXO[]> {
const fetchUtxos = async (address: string): Promise<UTXO[]> => {
const response = await fetch(`${API}/address/${address}/utxo`);
return response.json();
}
};

async function makeTransaction(
const makeTransaction = async (
to: string,
key: any,
amount: any,
utxos: any,
address: string,
memo: string = ""
) {
) => {
if (memo.length >= 78) throw new Error("Memo too long");
utxos.sort((a: any, b: any) => a.value - b.value); // sort by value, ascending
const fee = 10000;
Expand Down Expand Up @@ -94,7 +94,7 @@ async function makeTransaction(

psbt.finalizeAllInputs();
return psbt.extractTransaction().toHex();
}
};

const main = async (args: any, hre: HardhatRuntimeEnvironment) => {
const pk = process.env.PRIVATE_KEY as any;
Expand Down

0 comments on commit c93fee5

Please sign in to comment.