This commit is contained in:
Tim Olson
2023-11-14 02:13:22 -04:00
parent e0eea24f00
commit 34b579f204
2 changed files with 29 additions and 8 deletions

View File

@@ -1,8 +1,10 @@
<template>
<phone-card v-if="s.mockenv && s.vault">
<v-card-title><v-icon icon="mdi-faucet"/>&nbsp;Mock Coin Faucet</v-card-title>
<v-card-text>The Dexorder testnet provides infinite amounts of MEH (Mock Ethernet Hardfork) and USXD (Joke Currency XD) for your vault. Click the button below to get a million of each: </v-card-text>
<phone-card v-if="s.mockenv && s.vault" class="maxw">
<v-card-title><v-icon icon="mdi-faucet"/>&nbsp;Testnet Faucet</v-card-title>
<v-card-text>The Dexorder testnet faucet will send 1 TETH (Testnet ETH) to your account, plus 10 MEH (Mock Ethernet Hardfork) and 10,000 USXD (Joke Currency XD) to your vault.</v-card-text>
<v-card-text>Click below to get free test tokens: </v-card-text>
<v-card-item>
<!--
<v-table plain>
<tbody>
<tr v-for="token of tokens">
@@ -11,6 +13,8 @@
</tr>
</tbody>
</v-table>
-->
<btn icon='mdi-plus' color="green" :disabled="disabled" @click="gib">GIB!</btn>
</v-card-item>
</phone-card>
</template>
@@ -22,9 +26,12 @@ import {ethers} from "ethers";
import {computed, ref} from "vue";
import {pendTransaction} from "@/blockchain/wallet.js";
import {mockErc20Abi} from "@/blockchain/abi.js";
import Btn from "@/components/Btn.vue";
import {socket} from "@/socket.js";
const s = useStore()
/*
function gib(token) {
const tokenAddr = token.address
const vault = s.vault
@@ -34,6 +41,20 @@ function gib(token) {
}
pendTransaction(send)
}
*/
const disabled = ref(false)
function gib() {
const s = useStore()
if( s.account ) {
disabled.value = true
socket.emit('faucet', s.chainId, s.account)
setTimeout(()=>disabled.value=false,
1000) // todo
// 60*1000)
}
}
const tokens = computed(()=>!s.mockCoins? [] : s.mockCoins.map((addr)=>s.tokens[addr]))