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