This commit is contained in:
tim
2024-10-22 03:42:08 -04:00
parent 82fccc1be3
commit d33eca6931
12 changed files with 101 additions and 40 deletions

View File

@@ -23,7 +23,7 @@
<v-list-subheader title="ETH"/>
<v-list-item title="Wrap" key="wrap" value="wrap" prepend-icon="mdi-location-enter" @click="onWrap"/>
<v-list-item title="Withdraw" key="withdraw" value="withdraw" prepend-icon="mdi-arrow-down-bold"
@click="()=>onWithdraw()"/>
@click="onWithdraw"/>
</v-list>
</v-menu>
</td>

View File

@@ -33,7 +33,7 @@ import {FixedNumber} from "ethers";
const s = useStore()
const props = defineProps(['modelValue', 'vault', 'maxAmount'])
const emit = defineEmits(['update:modelValue'])
const balanceFloat = computed(() => Number(props.maxAmount)/1e18)
const balanceFloat = computed(() => Number(props.maxAmount)/1e18) // todo configurable native decimals
const floatAmount = ref(0)
function wrapNative() {

View File

@@ -23,7 +23,7 @@
<div v-if="status===Status.NEEDS_NETWORK">
<v-card-text>
Please connect your wallet to the Arbitrum-Sepolia test network to continue.
Please connect your wallet to the Arbitrum One network to continue.
</v-card-text>
</div>
@@ -39,7 +39,7 @@
<script setup>
import {useStore} from "@/store/store";
import {computed, ref} from "vue";
import {connectWallet, switchChain} from "@/blockchain/wallet.js";
import {addNetwork, connectWallet, switchChain} from "@/blockchain/wallet.js";
import Btn from "@/components/Btn.vue";
import Logo from "@/components/Logo.vue";
import BetaSignin from "@/components/BetaSignin.vue";
@@ -75,6 +75,14 @@ async function connect() {
// explicit user rejection
return
}
else if (e.code===4902) {
try {
await addNetwork(s.chainId)
}
catch (e) {
console.log(`Could not add network ${s.chainId}`)
}
}
else
console.log('switchChain() failure',e)
}

View File

@@ -133,7 +133,7 @@ body {
}
.top {
height: 68%;
height: 60%;
width: 100%;
min-height: 5em;
}

View File

@@ -11,12 +11,6 @@
</v-card-text>
</div>
<div v-if="hasVault">
<!--
<v-card-title>
Your Deposit Address {{ s.vaults.length > 1 ? '#' + (num + 1) : '' }}
</v-card-title> &lt;!&ndash; todo vault nicknames &ndash;&gt;
-->
<v-card-subtitle class="overflow-x-hidden">
<copy-button :text="addr">Deposit {{addr}}</copy-button>
</v-card-subtitle>
@@ -30,12 +24,12 @@
everything looks good.
</p>
-->
<p v-if="!s.mockenv">There are no funds currently in your vault.
<!-- todo re-enable deposit UI
Send tokens to the address above to fund your vault. -->
<p v-if="!s.mockenv">
There are no funds currently in your vault. Send tokens to the address above to fund your trading vault.
</p>
<p v-if="s.mockenv">
There are no funds currently in your vault. Use the faucet below to mint some testnet coins.
</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>

View File

@@ -2,7 +2,7 @@
<toolbar-pane title="Assets" icon="mdi-currency-btc">
<needs-signer>
<vault :owner="s.account" :num="0"/>
<faucet v-if="s.chainId in [1337, 31337, 421614]" variant="outlined" text="Get Free Testnet Coins!" style="width: 15em"/>
<faucet v-if="[1337, 31337, 421614].includes(s.chainId)" variant="outlined" text="Get Free Testnet Coins!" style="width: 15em"/>
</needs-signer>
</toolbar-pane>
</template>

View File

@@ -180,8 +180,10 @@ const endpoints = computed({
}
})
const alignTimes = ref(true)
const time1A = computed({
get() { return _endpoints.value[0] === null ? 0 : _endpoints.value[0][0] },
get() { return _endpoints.value[0] === null ? null : _endpoints.value[0][0] },
set(v) {
const flatline0 = _endpoints.value[0];
update(
@@ -203,7 +205,7 @@ const price1A = computed({
})
const time1B = computed({
get() { return _endpoints.value[0] === null ? 0 : _endpoints.value[0][2] },
get() { return _endpoints.value[0] === null ? null : _endpoints.value[0][2] },
set(v) {
const flatline0 = _endpoints.value[0];
update(
@@ -225,7 +227,7 @@ const price1B = computed({
})
const time2A = computed({
get() { return _endpoints.value[1] === null ? 0 : _endpoints.value[1][0] },
get() { return _endpoints.value[1] === null ? null : _endpoints.value[1][0] },
set(v) {
const flatline = _endpoints.value[1];
update(
@@ -247,7 +249,7 @@ const price2A = computed({
})
const time2B = computed({
get() { return _endpoints.value[1] === null ? 0 : _endpoints.value[1][2] },
get() { return _endpoints.value[1] === null ? null : _endpoints.value[1][2] },
set(v) {
const flatline = _endpoints.value[1];
update(
@@ -288,7 +290,7 @@ function setShapes(a,b) {
}
const _extendLeft = ref(false)
const _extendLeft = ref(true)
const extendLeft = computed({
get() {return _extendLeft.value},
set(v) {
@@ -304,7 +306,7 @@ const extendLeft = computed({
})
const _extendRight = ref(false)
const _extendRight = ref(true)
const extendRight = computed({
get() {return _extendRight.value},
set(v) {

View File

@@ -7,7 +7,7 @@
<v-text-field type="number" v-model="rungs"
density="compact" hide-details class="mx-1 my-2" variant="outlined"
label="Rungs"
:color="color" :base-color="color" min="1"
:color="color" :base-color="color" min="1" :max="MAX_RUNGS"
:disabled="rungsDisabled"
style="width: 4.5em;"
/>
@@ -92,6 +92,7 @@ function setEndpoints(a, b) {
endpoints.value = [devectorize(a), devectorize(b)]
}
const MAX_RUNGS = 10 // todo remove arbitrary limit
const rungs = computed({
get() {
@@ -102,6 +103,8 @@ const rungs = computed({
props.builder.rungs = 1
return
}
if (r>MAX_RUNGS)
r = MAX_RUNGS
let [a,b] = endpoints.value
a = vectorize(a)
b = vectorize(b)