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]))

View File

@@ -22,7 +22,7 @@
</v-card-text>
</PhoneCard>
-->
<phone-card v-if="s.vaults.length<=num">
<phone-card v-if="s.vaults.length<=num" class="maxw">
<v-card-title><v-icon icon="mdi-safe-square" size="small" color="grey-darken-1"/> Create a Dexorder Vault</v-card-title>
<v-card-text v-if="num!==0"><!--todo-->Multiple vaults are not yet supported</v-card-text>
<!-- todo restore the vault-on-order approach for public beta
@@ -50,12 +50,12 @@
<v-card-text v-if="empty">
<p>
Your vault is a smart contract that securely holds your funds plus any orders you place. When your order
conditions are met, Dexorder creates a blockchain transaction for <code>vault.execute()</code>,
asking your vault to the order. Your vault then checks that order against the
current blockchain time and pool price, and only trades if everything looks good.
conditions are met, Dexorder creates a blockchain transaction asking your vault to execute the order. Your
vault then checks that order against the current blockchain time and pool price, and only trades if
everything looks good.
</p>
<p v-if="!s.mockenv">There are no funds currently in your vault. Send tokens to the address above to fund your vault.</p>
<p v-if="s.mockenv">There are no funds currently in your vault. Use the faucet below to mint some fake coins into your vault.</p>
<p v-if="s.mockenv">There are no funds currently in your vault. Use the faucet below to mint some testnet coins into your vault.</p>
</v-card-text>
<v-card-item v-if="!empty">
<v-table>