Fixing lint
This commit is contained in:
parent
93309d938d
commit
295afb58e2
@ -59,10 +59,8 @@ const verifyLiquidity = () => {
|
||||
|
||||
if (!walletAddress.value || tokenValue.value <= 0) return;
|
||||
|
||||
const found = depositsAddedList.value.find((element) => {
|
||||
const p2pixTokenValue = blockchain.formatBigNumber(
|
||||
element.args.amount
|
||||
);
|
||||
depositsAddedList.value.find((element) => {
|
||||
const p2pixTokenValue = blockchain.formatBigNumber(element.args.amount);
|
||||
if (
|
||||
tokenValue.value!! <= Number(p2pixTokenValue) &&
|
||||
tokenValue.value!! != 0 &&
|
||||
@ -71,7 +69,10 @@ const verifyLiquidity = () => {
|
||||
enableSelectButton.value = true;
|
||||
hasLiquidity.value = true;
|
||||
selectedDeposit.value = element;
|
||||
console.log("Selected is :", blockchain.formatBigNumber(element.args.amount))
|
||||
console.log(
|
||||
"Selected is :",
|
||||
blockchain.formatBigNumber(element.args.amount)
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -81,7 +82,6 @@ const verifyLiquidity = () => {
|
||||
hasLiquidity.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -18,7 +18,11 @@ const connectProvider = async () => {
|
||||
if (!connection) return;
|
||||
provider = new ethers.providers.Web3Provider(connection);
|
||||
const signer = provider.getSigner();
|
||||
const tokenContract = new ethers.Contract(addresses.token, mockToken.abi, signer);
|
||||
const tokenContract = new ethers.Contract(
|
||||
addresses.token,
|
||||
mockToken.abi,
|
||||
signer
|
||||
);
|
||||
|
||||
const walletAddress = await provider.send("eth_requestAccounts", []);
|
||||
const balance = await tokenContract.balanceOf(walletAddress[0]);
|
||||
@ -35,7 +39,7 @@ const connectProvider = async () => {
|
||||
|
||||
const filterLocks = p2pEvents.filters.LockAdded(null);
|
||||
const eventsLocks = await p2pEvents.queryFilter(filterLocks);
|
||||
console.log("Locks Added: ", eventsLocks)
|
||||
console.log("Locks Added: ", eventsLocks);
|
||||
etherStore.setLocksAddedList(eventsLocks);
|
||||
|
||||
const filterExpiredLocks = p2pEvents.filters.LockReturned(null);
|
||||
@ -149,7 +153,7 @@ const mapDeposits = async (depositId: BigNumber) => {
|
||||
|
||||
// Lock methods
|
||||
// Gets value from user's form to create a lock in the blockchain
|
||||
const addLock = async(depositId: Number, amount: Number) => {
|
||||
const addLock = async (depositId: Number, amount: Number) => {
|
||||
const etherStore = useEtherStore();
|
||||
const provider = getProvider();
|
||||
|
||||
@ -158,7 +162,7 @@ const addLock = async(depositId: Number, amount: Number) => {
|
||||
const p2pContract = new ethers.Contract(addresses.p2pix, p2pix.abi, signer);
|
||||
|
||||
// Make lock
|
||||
const lockTx = await p2pContract.lock(
|
||||
await p2pContract.lock(
|
||||
depositId,
|
||||
etherStore.walletAddress,
|
||||
ethers.constants.AddressZero,
|
||||
@ -170,12 +174,6 @@ const addLock = async(depositId: Number, amount: Number) => {
|
||||
const filterLocks = p2pContract.filters.LockAdded(null);
|
||||
const eventsLocks = await p2pContract.queryFilter(filterLocks);
|
||||
etherStore.setLocksAddedList(eventsLocks);
|
||||
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Get specific lock data by its ID
|
||||
@ -194,7 +192,7 @@ const mapLocks = async (lockId: string) => {
|
||||
|
||||
// Releases lock by specific ID and other additional data
|
||||
// (TO DO)
|
||||
const releaseLock = async() => {
|
||||
const releaseLock = async () => {
|
||||
return;
|
||||
};
|
||||
|
||||
|
@ -19,8 +19,11 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
console.log(depositDetail);
|
||||
|
||||
// Makes lock with deposit ID and the Amount
|
||||
if (depositDetail){
|
||||
const lock = await blockchain.addLock(depositDetail.args.depositID, tokenValue);
|
||||
if (depositDetail) {
|
||||
const lock = await blockchain.addLock(
|
||||
depositDetail.args.depositID,
|
||||
tokenValue
|
||||
);
|
||||
console.log(lock);
|
||||
|
||||
// (TO DO) Tirar isso daqui
|
||||
@ -39,9 +42,7 @@ const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
// Data to QRCode
|
||||
// Chave Pix = depositDetail.pixTarget
|
||||
// Valor = tokenValue
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user