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> <template>
<phone-card v-if="s.mockenv && s.vault"> <phone-card v-if="s.mockenv && s.vault" class="maxw">
<v-card-title><v-icon icon="mdi-faucet"/>&nbsp;Mock Coin Faucet</v-card-title> <v-card-title><v-icon icon="mdi-faucet"/>&nbsp;Testnet 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> <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-card-item>
<!--
<v-table plain> <v-table plain>
<tbody> <tbody>
<tr v-for="token of tokens"> <tr v-for="token of tokens">
@@ -11,6 +13,8 @@
</tr> </tr>
</tbody> </tbody>
</v-table> </v-table>
-->
<btn icon='mdi-plus' color="green" :disabled="disabled" @click="gib">GIB!</btn>
</v-card-item> </v-card-item>
</phone-card> </phone-card>
</template> </template>
@@ -22,9 +26,12 @@ import {ethers} from "ethers";
import {computed, ref} from "vue"; import {computed, ref} from "vue";
import {pendTransaction} from "@/blockchain/wallet.js"; import {pendTransaction} from "@/blockchain/wallet.js";
import {mockErc20Abi} from "@/blockchain/abi.js"; import {mockErc20Abi} from "@/blockchain/abi.js";
import Btn from "@/components/Btn.vue";
import {socket} from "@/socket.js";
const s = useStore() const s = useStore()
/*
function gib(token) { function gib(token) {
const tokenAddr = token.address const tokenAddr = token.address
const vault = s.vault const vault = s.vault
@@ -34,6 +41,20 @@ function gib(token) {
} }
pendTransaction(send) 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])) const tokens = computed(()=>!s.mockCoins? [] : s.mockCoins.map((addr)=>s.tokens[addr]))

View File

@@ -22,7 +22,7 @@
</v-card-text> </v-card-text>
</PhoneCard> </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-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> <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 <!-- todo restore the vault-on-order approach for public beta
@@ -50,12 +50,12 @@
<v-card-text v-if="empty"> <v-card-text v-if="empty">
<p> <p>
Your vault is a smart contract that securely holds your funds plus any orders you place. When your order 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>, conditions are met, Dexorder creates a blockchain transaction asking your vault to execute the order. Your
asking your vault to the order. Your vault then checks that order against the vault then checks that order against the current blockchain time and pool price, and only trades if
current blockchain time and pool price, and only trades if everything looks good. everything looks good.
</p> </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. 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-text>
<v-card-item v-if="!empty"> <v-card-item v-if="!empty">
<v-table> <v-table>