preparing props for next steps fafter search
This commit is contained in:
parent
c5162c1896
commit
ee35c17b6e
@ -13,7 +13,7 @@ const { walletAddress, depositList } = storeToRefs(etherStore);
|
||||
const tokenValue = ref(0);
|
||||
const enableSelectButton = ref(false);
|
||||
const hasLiquidity = ref(true);
|
||||
const validDecimals = ref(true)
|
||||
const validDecimals = ref(true);
|
||||
const selectedDeposit = ref();
|
||||
|
||||
const connectAccount = async () => {
|
||||
@ -26,7 +26,7 @@ const handleInputEvent = (event: any) => {
|
||||
|
||||
tokenValue.value = Number(value);
|
||||
|
||||
if (decimalCount(tokenValue.value) > 2){
|
||||
if (decimalCount(tokenValue.value) > 2) {
|
||||
validDecimals.value = false;
|
||||
enableSelectButton.value = false;
|
||||
return;
|
||||
@ -37,12 +37,12 @@ const handleInputEvent = (event: any) => {
|
||||
};
|
||||
|
||||
const decimalCount = (num: Number) => {
|
||||
const numStr = String(num);
|
||||
if (numStr.includes('.')) {
|
||||
return numStr.split('.')[1].length;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
const numStr = String(num);
|
||||
if (numStr.includes(".")) {
|
||||
return numStr.split(".")[1].length;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
const verifyLiquidity = () => {
|
||||
enableSelectButton.value = false;
|
||||
|
@ -131,6 +131,7 @@ const mapDeposits = async (depositId: BigNumber) => {
|
||||
const deposit = await contract.mapDeposits(depositId);
|
||||
|
||||
console.log(deposit);
|
||||
return deposit;
|
||||
};
|
||||
|
||||
const formatEther = (balance: string) => {
|
||||
|
@ -1,11 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import SearchComponent from "../components/SearchComponent.vue";
|
||||
import blockchain from "../utils/blockchain";
|
||||
|
||||
const confirmBuyClick = ({ selectedDeposit, tokenValue }: any) => {
|
||||
const confirmBuyClick = async ({ selectedDeposit, tokenValue }: any) => {
|
||||
// finish buy screen
|
||||
console.log(selectedDeposit);
|
||||
let depositDetail;
|
||||
await blockchain
|
||||
.mapDeposits(selectedDeposit["args"]["depositID"])
|
||||
.then((deposit) => (depositDetail = deposit));
|
||||
console.log(tokenValue);
|
||||
console.log("compra confirmada");
|
||||
console.log(depositDetail);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -69,7 +69,7 @@ const mapDeposit = (depositId: BigNumber) => {
|
||||
:key="deposit['blockNumber']"
|
||||
@click="mapDeposit(deposit['args']['depositID'])"
|
||||
>
|
||||
Address:<br>{{ deposit["args"]["0"] }}<br>
|
||||
Address:<br />{{ deposit["args"]["0"] }}<br />
|
||||
MRBZ: {{ blockchain.formatEther(deposit["args"]["amount"]) }}
|
||||
</li>
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user