Contracts addresses, getLiquidity function and blockchain (deposit, lock, release) methods corrected

This commit is contained in:
brunoedcf
2023-01-31 14:38:34 -03:00
parent d665376eb4
commit d569294648
13 changed files with 305 additions and 172 deletions

View File

@@ -27,7 +27,7 @@ etherStore.setSellerView(false);
// States
const { loadingLock, walletAddress } = storeToRefs(etherStore);
const flowStep = ref<Step>(Step.Search);
const pixTarget = ref<string>("");
const pixTarget = ref<number>();
const tokenAmount = ref<number>();
const _lockID = ref<string>("");
const loadingRelease = ref<boolean>(false);
@@ -46,7 +46,7 @@ const confirmBuyClick = async (
flowStep.value = Step.Buy;
etherStore.setLoadingLock(true);
await addLock(selectedDeposit.depositID, tokenValue)
await addLock(selectedDeposit.seller, selectedDeposit.token, tokenValue)
.then((lockID) => {
_lockID.value = lockID;
})
@@ -63,7 +63,7 @@ const releaseTransaction = async (e2eId: string) => {
flowStep.value = Step.List;
loadingRelease.value = true;
if (_lockID.value && tokenAmount.value) {
if (_lockID.value && tokenAmount.value && pixTarget.value) {
const release = await releaseLock(
pixTarget.value,
tokenAmount.value,
@@ -96,7 +96,7 @@ onMounted(async () => {
/>
<div v-if="flowStep == Step.Buy">
<QrCodeComponent
:pixTarget="pixTarget"
:pixTarget="String(pixTarget)"
:tokenValue="tokenAmount"
@pix-validated="releaseTransaction"
v-if="!loadingLock"