Fixing release function and formatting functions

This commit is contained in:
Bruno
2022-12-07 21:28:34 -03:00
parent f25c61b21e
commit 50835c94ed
4 changed files with 57 additions and 79 deletions

View File

@@ -13,52 +13,28 @@ enum Step {
const flowStep = ref<Step>(Step.Search)
const tokenAmmount = ref()
// (TO DO) Tirar isso tudo daqui
// import p2pix from "../utils/smart_contract_files/P2PIX.json";
// import addresses from "../utils/smart_contract_files/localhost.json";
// import { useEtherStore } from "@/store/ether";
// import { ethers } from "ethers";
const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
// finish buy screen
console.log(selectedDeposit);
let depositDetail;
await blockchain
.mapDeposits(selectedDeposit["args"]["depositID"])
.mapDeposits(selectedDeposit.args.depositID)
.then((deposit) => (depositDetail = deposit));
console.log(tokenValue);
tokenAmmount.value = tokenValue
flowStep.value = Step.List
console.log(depositDetail);
console.log(depositDetail);
// Makes lock with deposit ID and the Amount
// if (depositDetail) {
// const lock = await blockchain.addLock(
// depositDetail.args.depositID,
// tokenValue
// );
// console.log(lock);
if (depositDetail) {
const lock = await blockchain.addLock(
selectedDeposit.args.depositID,
tokenValue
);
console.log(lock);
};
// // (TO DO) Tirar isso daqui
// const window_ = window as any;
// const connection = window_.ethereum;
// let provider: ethers.providers.Web3Provider | null = null;
// if (!connection) return;
// provider = new ethers.providers.Web3Provider(connection);
// const signer = provider.getSigner();
// const etherStore = useEtherStore();
// const p2pContract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
// const filterLocks = p2pContract.filters.LockAdded(null);
// const eventsLocks = await p2pContract.queryFilter(filterLocks);
// etherStore.setLocksAddedList(eventsLocks);
// Data to QRCode
// Chave Pix = depositDetail.pixTarget
// Valor = tokenValue
// }
};
};
</script>
<template>