Add typing on components layer
Co-authored-by: geovanne97 <geovannessaraiva97@gmail.com>
This commit is contained in:
parent
846fa82f04
commit
4999f3d145
@ -35,7 +35,7 @@ const addLock = async (depositId: BigNumber, amount: number): Promise<any> => {
|
|||||||
// Release lock
|
// Release lock
|
||||||
const releaseLock = async (
|
const releaseLock = async (
|
||||||
pixKey: string,
|
pixKey: string,
|
||||||
amount: Number,
|
amount: number,
|
||||||
e2eId: string,
|
e2eId: string,
|
||||||
lockId: string
|
lockId: string
|
||||||
): Promise<any> => {
|
): Promise<any> => {
|
||||||
|
@ -65,13 +65,13 @@ const getValidDeposits = async (
|
|||||||
const mappedDeposit = await p2pContract.mapDeposits(
|
const mappedDeposit = await p2pContract.mapDeposits(
|
||||||
deposit.args?.depositID
|
deposit.args?.depositID
|
||||||
);
|
);
|
||||||
let validDeposit = {};
|
let validDeposit: ValidDeposit | undefined = undefined;
|
||||||
|
|
||||||
if (mappedDeposit.valid) {
|
if (mappedDeposit.valid) {
|
||||||
validDeposit = {
|
validDeposit = {
|
||||||
blockNumber: deposit.blockNumber,
|
blockNumber: deposit.blockNumber,
|
||||||
depositID: deposit.args?.depositID,
|
depositID: deposit.args?.depositID,
|
||||||
remaining: formatEther(mappedDeposit.remaining),
|
remaining: Number(formatEther(mappedDeposit.remaining)),
|
||||||
seller: mappedDeposit.seller,
|
seller: mappedDeposit.seller,
|
||||||
pixKey: mappedDeposit.pixTarget,
|
pixKey: mappedDeposit.pixTarget,
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { getProvider } from "./provider";
|
import { getProvider } from "./provider";
|
||||||
import { updateWalletStatus } from "./wallet";
|
|
||||||
import { getTokenAddress, getP2PixAddress } from "./addresses";
|
import { getTokenAddress, getP2PixAddress } from "./addresses";
|
||||||
import { parseEther } from "ethers/lib/utils";
|
import { parseEther } from "ethers/lib/utils";
|
||||||
|
|
||||||
@ -8,9 +7,6 @@ import { ethers } from "ethers";
|
|||||||
import p2pix from "../utils/smart_contract_files/P2PIX.json";
|
import p2pix from "../utils/smart_contract_files/P2PIX.json";
|
||||||
import mockToken from "../utils/smart_contract_files/MockToken.json";
|
import mockToken from "../utils/smart_contract_files/MockToken.json";
|
||||||
|
|
||||||
// Seller Flow methods //
|
|
||||||
|
|
||||||
// Approve Tokens
|
|
||||||
const approveTokens = async (tokenQty: string): Promise<any> => {
|
const approveTokens = async (tokenQty: string): Promise<any> => {
|
||||||
const provider = getProvider();
|
const provider = getProvider();
|
||||||
const signer = provider.getSigner();
|
const signer = provider.getSigner();
|
||||||
@ -31,7 +27,6 @@ const approveTokens = async (tokenQty: string): Promise<any> => {
|
|||||||
return apprv;
|
return apprv;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add deposit
|
|
||||||
const addDeposit = async (tokenQty: string, pixKey: string): Promise<any> => {
|
const addDeposit = async (tokenQty: string, pixKey: string): Promise<any> => {
|
||||||
const provider = getProvider();
|
const provider = getProvider();
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CustomButton from "@/components/CustomButton.vue";
|
import CustomButton from "@/components/CustomButton.vue";
|
||||||
import ListingComponent from "@/components/ListingComponent.vue";
|
import ListingComponent from "@/components/ListingComponent.vue";
|
||||||
|
import type { Event } from "ethers";
|
||||||
|
|
||||||
// props
|
// props
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
lastWalletReleaseTransactions: any[];
|
lastWalletReleaseTransactions: Event[];
|
||||||
tokenAmount: Number | undefined;
|
tokenAmount: number | undefined;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { ValidDeposit } from "@/model/ValidDeposit";
|
||||||
import { formatEther } from "@ethersproject/units";
|
import { formatEther } from "@ethersproject/units";
|
||||||
|
import type { Event } from "ethers";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
|
|
||||||
// props
|
// props
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
walletTransactions: any[];
|
walletTransactions: (Event | ValidDeposit)[];
|
||||||
isManageMode: boolean;
|
isManageMode: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const itemsToShow = ref<any[]>([]);
|
const itemsToShow = ref<(Event | ValidDeposit)[]>([]);
|
||||||
|
|
||||||
// Methods
|
// Methods
|
||||||
const showInitialItems = () => {
|
const isValidDeposit = (
|
||||||
|
deposit: Event | ValidDeposit
|
||||||
|
): deposit is ValidDeposit => {
|
||||||
|
return (deposit as ValidDeposit).depositID !== undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
const showInitialItems = (): void => {
|
||||||
itemsToShow.value = props.walletTransactions.slice(0, 3);
|
itemsToShow.value = props.walletTransactions.slice(0, 3);
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatEventsAmount = (amount: any) => {
|
const openEtherscanUrl = (url: string): void => {
|
||||||
try {
|
|
||||||
const formated = formatEther(amount);
|
|
||||||
return formated;
|
|
||||||
} catch {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const openEtherscanUrl = (url: string) => {
|
|
||||||
window.open(url, "_blank");
|
window.open(url, "_blank");
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadMore = () => {
|
const loadMore = (): void => {
|
||||||
const itemsShowing = itemsToShow.value.length;
|
const itemsShowing = itemsToShow.value.length;
|
||||||
itemsToShow.value?.push(
|
itemsToShow.value?.push(
|
||||||
...props.walletTransactions.slice(itemsShowing, itemsShowing + 3)
|
...props.walletTransactions.slice(itemsShowing, itemsShowing + 3)
|
||||||
@ -36,7 +35,7 @@ const loadMore = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// watch props changes
|
// watch props changes
|
||||||
watch(props, async () => {
|
watch(props, async (): Promise<void> => {
|
||||||
const itemsToShowQty = itemsToShow.value.length;
|
const itemsToShowQty = itemsToShow.value.length;
|
||||||
if (itemsToShowQty == 0) showInitialItems();
|
if (itemsToShowQty == 0) showInitialItems();
|
||||||
else
|
else
|
||||||
@ -75,11 +74,11 @@ showInitialItems();
|
|||||||
<div
|
<div
|
||||||
class="grid grid-cols-4 grid-flow-row w-full bg-white px-6 py-4 rounded-lg"
|
class="grid grid-cols-4 grid-flow-row w-full bg-white px-6 py-4 rounded-lg"
|
||||||
v-for="(item, index) in itemsToShow"
|
v-for="(item, index) in itemsToShow"
|
||||||
:key="item.depositID"
|
:key="item.blockNumber"
|
||||||
>
|
>
|
||||||
<span class="last-release-info">
|
<span class="last-release-info">
|
||||||
{{
|
{{
|
||||||
item?.args ? formatEventsAmount(item?.args.amount) : item?.remaining
|
isValidDeposit(item) ? item.remaining : formatEther(item.args?.amount)
|
||||||
}}
|
}}
|
||||||
BRZ
|
BRZ
|
||||||
</span>
|
</span>
|
||||||
@ -90,7 +89,7 @@ showInitialItems();
|
|||||||
<div
|
<div
|
||||||
v-if="props.isManageMode"
|
v-if="props.isManageMode"
|
||||||
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
||||||
@click="emit('cancelDeposit', item.depositID, index)"
|
@click="emit('cancelDeposit', (item as ValidDeposit).depositID, index)"
|
||||||
>
|
>
|
||||||
<span class="last-release-info">Cancelar</span>
|
<span class="last-release-info">Cancelar</span>
|
||||||
<img alt="Cancel image" src="@/assets/cancel.svg" />
|
<img alt="Cancel image" src="@/assets/cancel.svg" />
|
||||||
@ -98,21 +97,21 @@ showInitialItems();
|
|||||||
|
|
||||||
<span
|
<span
|
||||||
class="last-release-info"
|
class="last-release-info"
|
||||||
v-if="item.event == 'DepositAdded' && !props.isManageMode"
|
v-if="(item as Event).event == 'DepositAdded' && !props.isManageMode"
|
||||||
>
|
>
|
||||||
{{ "Oferta" }}
|
{{ "Oferta" }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="last-release-info"
|
class="last-release-info"
|
||||||
v-if="item.event == 'LockAdded' && !props.isManageMode"
|
v-if="(item as Event).event == 'LockAdded' && !props.isManageMode"
|
||||||
>
|
>
|
||||||
{{ "Reserva" }}
|
{{ "Reserva" }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
class="last-release-info"
|
class="last-release-info"
|
||||||
v-if="item.event == 'LockReleased' && !props.isManageMode"
|
v-if="(item as Event).event == 'LockReleased' && !props.isManageMode"
|
||||||
>
|
>
|
||||||
{{ "Compra" }}
|
{{ "Compra" }}
|
||||||
</span>
|
</span>
|
||||||
@ -120,7 +119,9 @@ showInitialItems();
|
|||||||
<div
|
<div
|
||||||
v-if="props.isManageMode"
|
v-if="props.isManageMode"
|
||||||
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
||||||
@click="emit('withdrawDeposit', item.depositID, index)"
|
@click="
|
||||||
|
emit('withdrawDeposit', (item as ValidDeposit).depositID, index)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<span class="last-release-info">Retirar</span>
|
<span class="last-release-info">Retirar</span>
|
||||||
<img alt="Cancel image" src="@/assets/withdraw.svg" />
|
<img alt="Cancel image" src="@/assets/withdraw.svg" />
|
||||||
@ -130,7 +131,9 @@ showInitialItems();
|
|||||||
v-if="!props.isManageMode"
|
v-if="!props.isManageMode"
|
||||||
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
class="flex gap-2 cursor-pointer items-center justify-self-center"
|
||||||
@click="
|
@click="
|
||||||
openEtherscanUrl(`https://etherscan.io/tx/${item?.transactionHash}`)
|
openEtherscanUrl(
|
||||||
|
`https://etherscan.io/tx/${(item as Event)?.transactionHash}`
|
||||||
|
)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<span class="last-release-info">Etherscan</span>
|
<span class="last-release-info">Etherscan</span>
|
||||||
|
@ -24,19 +24,20 @@ const pixQrCode = pix({
|
|||||||
pixKey: props.pixTarget ?? "",
|
pixKey: props.pixTarget ?? "",
|
||||||
value: props.tokenValue,
|
value: props.tokenValue,
|
||||||
});
|
});
|
||||||
|
|
||||||
pixQrCode.base64QrCode().then((code: string) => {
|
pixQrCode.base64QrCode().then((code: string) => {
|
||||||
qrCode.value = code;
|
qrCode.value = code;
|
||||||
});
|
});
|
||||||
|
|
||||||
qrCodePayload.value = pixQrCode.payload();
|
qrCodePayload.value = pixQrCode.payload();
|
||||||
|
|
||||||
const handleInputEvent = (event: any) => {
|
const handleInputEvent = async (event: any): Promise<void> => {
|
||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
e2eId.value = value;
|
e2eId.value = value;
|
||||||
validatePix();
|
await validatePix();
|
||||||
};
|
};
|
||||||
|
|
||||||
const validatePix = async () => {
|
const validatePix = async (): Promise<void> => {
|
||||||
if (e2eId.value == "") {
|
if (e2eId.value == "") {
|
||||||
isPixValid.value = false;
|
isPixValid.value = false;
|
||||||
isCodeInputEmpty.value = true;
|
isCodeInputEmpty.value = true;
|
||||||
|
@ -7,6 +7,7 @@ import { storeToRefs } from "pinia";
|
|||||||
import { connectProvider } from "@/blockchain/provider";
|
import { connectProvider } from "@/blockchain/provider";
|
||||||
import { verifyNetworkLiquidity } from "@/utils/networkLiquidity";
|
import { verifyNetworkLiquidity } from "@/utils/networkLiquidity";
|
||||||
import { NetworkEnum } from "@/model/NetworkEnum";
|
import { NetworkEnum } from "@/model/NetworkEnum";
|
||||||
|
import type { ValidDeposit } from "@/model/ValidDeposit";
|
||||||
|
|
||||||
// Store reference
|
// Store reference
|
||||||
const etherStore = useEtherStore();
|
const etherStore = useEtherStore();
|
||||||
@ -19,25 +20,25 @@ const {
|
|||||||
} = storeToRefs(etherStore);
|
} = storeToRefs(etherStore);
|
||||||
|
|
||||||
// Reactive state
|
// Reactive state
|
||||||
const tokenValue = ref(0);
|
const tokenValue = ref<number>(0);
|
||||||
const enableConfirmButton = ref(false);
|
const enableConfirmButton = ref<boolean>(false);
|
||||||
const enableWalletButton = ref(false);
|
const enableWalletButton = ref<boolean>(false);
|
||||||
const hasLiquidity = ref(true);
|
const hasLiquidity = ref<boolean>(true);
|
||||||
const validDecimals = ref(true);
|
const validDecimals = ref<boolean>(true);
|
||||||
const selectedGoerliDeposit = ref();
|
const selectedGoerliDeposit = ref<ValidDeposit>();
|
||||||
const selectedMumbaiDeposit = ref();
|
const selectedMumbaiDeposit = ref<ValidDeposit>();
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(["tokenBuy"]);
|
const emit = defineEmits(["tokenBuy"]);
|
||||||
|
|
||||||
// Blockchain methods
|
// Blockchain methods
|
||||||
const connectAccount = async () => {
|
const connectAccount = async (): Promise<void> => {
|
||||||
await connectProvider();
|
await connectProvider();
|
||||||
|
|
||||||
enableOrDisableConfirmButton();
|
enableOrDisableConfirmButton();
|
||||||
};
|
};
|
||||||
|
|
||||||
const emitConfirmButton = () => {
|
const emitConfirmButton = (): void => {
|
||||||
const selectedDeposit =
|
const selectedDeposit =
|
||||||
networkName.value == NetworkEnum.ethereum
|
networkName.value == NetworkEnum.ethereum
|
||||||
? selectedGoerliDeposit.value
|
? selectedGoerliDeposit.value
|
||||||
@ -46,7 +47,7 @@ const emitConfirmButton = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Debounce methods
|
// Debounce methods
|
||||||
const handleInputEvent = (event: any) => {
|
const handleInputEvent = (event: any): void => {
|
||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
|
|
||||||
tokenValue.value = Number(value);
|
tokenValue.value = Number(value);
|
||||||
@ -63,7 +64,7 @@ const handleInputEvent = (event: any) => {
|
|||||||
|
|
||||||
// Enable button methods
|
// Enable button methods
|
||||||
// Check if has more than 2 decimal places
|
// Check if has more than 2 decimal places
|
||||||
const decimalCount = (num: Number) => {
|
const decimalCount = (num: number): number => {
|
||||||
const numStr = String(num);
|
const numStr = String(num);
|
||||||
if (numStr.includes(".")) {
|
if (numStr.includes(".")) {
|
||||||
return numStr.split(".")[1].length;
|
return numStr.split(".")[1].length;
|
||||||
@ -72,10 +73,10 @@ const decimalCount = (num: Number) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Verify if there is a valid deposit to buy
|
// Verify if there is a valid deposit to buy
|
||||||
const verifyLiquidity = () => {
|
const verifyLiquidity = (): void => {
|
||||||
enableConfirmButton.value = false;
|
enableConfirmButton.value = false;
|
||||||
selectedGoerliDeposit.value = null;
|
selectedGoerliDeposit.value = undefined;
|
||||||
selectedMumbaiDeposit.value = null;
|
selectedMumbaiDeposit.value = undefined;
|
||||||
|
|
||||||
if (tokenValue.value <= 0) {
|
if (tokenValue.value <= 0) {
|
||||||
enableWalletButton.value = false;
|
enableWalletButton.value = false;
|
||||||
@ -111,7 +112,7 @@ const enableOrDisableConfirmButton = (): void => {
|
|||||||
else enableConfirmButton.value = false;
|
else enableConfirmButton.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(networkName, async () => {
|
watch(networkName, (): void => {
|
||||||
enableOrDisableConfirmButton();
|
enableOrDisableConfirmButton();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -4,16 +4,16 @@ import CustomButton from "../../components/CustomButton.vue";
|
|||||||
import { debounce } from "@/utils/debounce";
|
import { debounce } from "@/utils/debounce";
|
||||||
|
|
||||||
// Reactive state
|
// Reactive state
|
||||||
const tokenValue = ref(0);
|
const tokenValue = ref<number>(0);
|
||||||
const enableSelectButton = ref(false);
|
const enableSelectButton = ref<boolean>(false);
|
||||||
const hasLiquidity = ref(true);
|
const hasLiquidity = ref<boolean>(true);
|
||||||
const validDecimals = ref(true);
|
const validDecimals = ref<boolean>(true);
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(["tokenBuy"]);
|
const emit = defineEmits(["tokenBuy"]);
|
||||||
|
|
||||||
// Debounce methods
|
// Debounce methods
|
||||||
const handleInputEvent = (event: any) => {
|
const handleInputEvent = (event: any): void => {
|
||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
|
|
||||||
tokenValue.value = Number(value);
|
tokenValue.value = Number(value);
|
||||||
@ -28,7 +28,7 @@ const handleInputEvent = (event: any) => {
|
|||||||
|
|
||||||
// Enable button methods
|
// Enable button methods
|
||||||
// Check if has more than 2 decimal places
|
// Check if has more than 2 decimal places
|
||||||
const decimalCount = (num: Number) => {
|
const decimalCount = (num: number): number => {
|
||||||
const numStr = String(num);
|
const numStr = String(num);
|
||||||
if (numStr.includes(".")) {
|
if (numStr.includes(".")) {
|
||||||
return numStr.split(".")[1].length;
|
return numStr.split(".")[1].length;
|
||||||
|
@ -7,15 +7,15 @@ import { debounce } from "@/utils/debounce";
|
|||||||
const offer = ref<string | number>("");
|
const offer = ref<string | number>("");
|
||||||
const pixKey = ref<string>("");
|
const pixKey = ref<string>("");
|
||||||
|
|
||||||
const enableSelectButton = ref(false);
|
const enableSelectButton = ref<boolean>(false);
|
||||||
const hasLiquidity = ref(true);
|
const hasLiquidity = ref<boolean>(true);
|
||||||
const validDecimals = ref(true);
|
const validDecimals = ref<boolean>(true);
|
||||||
|
|
||||||
// Emits
|
// Emits
|
||||||
const emit = defineEmits(["approveTokens"]);
|
const emit = defineEmits(["approveTokens"]);
|
||||||
|
|
||||||
// Debounce methods
|
// Debounce methods
|
||||||
const handleInputEvent = (event: any) => {
|
const handleInputEvent = (event: any): void => {
|
||||||
const { value } = event.target;
|
const { value } = event.target;
|
||||||
|
|
||||||
offer.value = Number(value);
|
offer.value = Number(value);
|
||||||
@ -30,7 +30,7 @@ const handleInputEvent = (event: any) => {
|
|||||||
|
|
||||||
// Enable button methods
|
// Enable button methods
|
||||||
// Check if has more than 2 decimal places
|
// Check if has more than 2 decimal places
|
||||||
const decimalCount = (num: Number) => {
|
const decimalCount = (num: Number): number => {
|
||||||
const numStr = String(num);
|
const numStr = String(num);
|
||||||
if (numStr.includes(".")) {
|
if (numStr.includes(".")) {
|
||||||
return numStr.split(".")[1].length;
|
return numStr.split(".")[1].length;
|
||||||
|
@ -19,8 +19,8 @@ const currencyMenuOpenToggle = ref<boolean>(false);
|
|||||||
const currencyMenuHoverToggle = ref<boolean>(false);
|
const currencyMenuHoverToggle = ref<boolean>(false);
|
||||||
|
|
||||||
//Methods
|
//Methods
|
||||||
const connectMetaMask = () => {
|
const connectMetaMask = async (): Promise<void> => {
|
||||||
connectProvider();
|
await connectProvider();
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatWalletAddress = (): string => {
|
const formatWalletAddress = (): string => {
|
||||||
@ -33,28 +33,28 @@ const formatWalletAddress = (): string => {
|
|||||||
return `${initialText}...${finalText}`;
|
return `${initialText}...${finalText}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const formatWalletBalance = (): String => {
|
const formatWalletBalance = (): string => {
|
||||||
const fixed = Number(balance.value);
|
const fixed = Number(balance.value);
|
||||||
return fixed.toFixed(2);
|
return fixed.toFixed(2);
|
||||||
};
|
};
|
||||||
|
|
||||||
const disconnectUser = () => {
|
const disconnectUser = (): void => {
|
||||||
etherStore.setWalletAddress("");
|
etherStore.setWalletAddress("");
|
||||||
closeMenu();
|
closeMenu();
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeMenu = () => {
|
const closeMenu = (): void => {
|
||||||
menuOpenToggle.value = false;
|
menuOpenToggle.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const networkChange = async (network: NetworkEnum) => {
|
const networkChange = async (network: NetworkEnum): Promise<void> => {
|
||||||
currencyMenuOpenToggle.value = false;
|
currencyMenuOpenToggle.value = false;
|
||||||
const change = await requestNetworkChange(network);
|
const change = await requestNetworkChange(network);
|
||||||
if (change) etherStore.setNetworkName(network);
|
if (change) etherStore.setNetworkName(network);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNetworkImage = (networkName: NetworkEnum) => {
|
const getNetworkImage = (networkName: NetworkEnum): string => {
|
||||||
let validImages = {
|
let validImages = {
|
||||||
Ethereum: ethereumImage,
|
Ethereum: ethereumImage,
|
||||||
Polygon: polygonImage,
|
Polygon: polygonImage,
|
||||||
|
@ -3,7 +3,7 @@ import type { BigNumber } from "ethers";
|
|||||||
export type ValidDeposit = {
|
export type ValidDeposit = {
|
||||||
depositID: BigNumber;
|
depositID: BigNumber;
|
||||||
blockNumber: number;
|
blockNumber: number;
|
||||||
remaining: string;
|
remaining: number;
|
||||||
seller: string;
|
seller: string;
|
||||||
pixKey: string;
|
pixKey: string;
|
||||||
pixTarget?: string;
|
pixTarget?: string;
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
import type { ValidDeposit } from "@/model/ValidDeposit";
|
||||||
|
|
||||||
const verifyNetworkLiquidity = (
|
const verifyNetworkLiquidity = (
|
||||||
tokenValue: number,
|
tokenValue: number,
|
||||||
walletAddress: string,
|
walletAddress: string,
|
||||||
validDepositList: any[]
|
validDepositList: ValidDeposit[]
|
||||||
) => {
|
): ValidDeposit | undefined => {
|
||||||
const element = validDepositList.find((element) => {
|
const element = validDepositList.find((element) => {
|
||||||
const remaining = element.remaining;
|
const remaining = element.remaining;
|
||||||
if (
|
if (
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
import { useEtherStore } from "@/store/ether";
|
import { useEtherStore } from "@/store/ether";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
import ListingComponent from "@/components/ListingComponent.vue";
|
import ListingComponent from "@/components/ListingComponent.vue";
|
||||||
import type { BigNumber, Event } from "ethers";
|
import type { BigNumber } from "ethers";
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
import { cancelDeposit, withdrawDeposit } from "@/blockchain/buyerMethods";
|
import { cancelDeposit, withdrawDeposit } from "@/blockchain/buyerMethods";
|
||||||
import { listValidDepositTransactionsByWalletAddress } from "@/blockchain/wallet";
|
import { listValidDepositTransactionsByWalletAddress } from "@/blockchain/wallet";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user