From 68d9a32b5cb3b011b720f83c46405b3ad21c1c4a Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 11 Jul 2024 00:50:54 -0400 Subject: [PATCH] separb beta --- .env-arbsep | 1 + src/blockchain/contract.js | 5 +- src/blockchain/wallet.js | 18 ------- src/charts/jBars.js | 2 +- src/components/Faucet.vue | 5 +- src/components/NeedsSigner.vue | 88 +++++++++++----------------------- src/components/Vault.vue | 78 +++++++++++++----------------- src/corp/AppBtn.vue | 2 +- src/corp/MenuBar.vue | 2 +- src/layouts/default/AppBar.vue | 2 +- src/store/store.js | 1 - 11 files changed, 74 insertions(+), 130 deletions(-) create mode 100644 .env-arbsep diff --git a/.env-arbsep b/.env-arbsep new file mode 100644 index 0000000..b3f4a15 --- /dev/null +++ b/.env-arbsep @@ -0,0 +1 @@ +VITE_WS_URL=wss://ws.beta.dexorder.trade diff --git a/src/blockchain/contract.js b/src/blockchain/contract.js index 7dac57a..b304090 100644 --- a/src/blockchain/contract.js +++ b/src/blockchain/contract.js @@ -1,5 +1,6 @@ import {ethers} from "ethers"; import {AbiURLCache} from "../common.js"; +import {provider as walletProvider} from "@/blockchain/wallet.js"; export const abiCache = new AbiURLCache('/contract/out/') @@ -39,6 +40,8 @@ export async function erc20Contract(addr, provider) { } -export async function vaultContract(addr, provider) { +export async function vaultContract(addr, provider=null) { + if (provider===null) + provider = walletProvider return await newContract(addr, 'IVault', provider) } diff --git a/src/blockchain/wallet.js b/src/blockchain/wallet.js index bee12a3..f7a3296 100644 --- a/src/blockchain/wallet.js +++ b/src/blockchain/wallet.js @@ -167,24 +167,6 @@ export async function switchChain(chainId) { } -export async function addTestnet() { - const info = { - "chainId": "0x539", - "chainName": "Dexorder Alpha Testnet", - "rpcUrls": ["https://rpc.alpha.dexorder.trade"], - "nativeCurrency": { - "name": "Test Ethereum", - "symbol": "TETH", - "decimals": 18 - } - }; - await window.ethereum.request({ - "method": "wallet_addEthereumChain", - "params": [info] - }); -} - - function discoverVaults(owner) { const s = useStore() console.log('discoverVaults', owner) diff --git a/src/charts/jBars.js b/src/charts/jBars.js index 2649e0a..e729bbc 100644 --- a/src/charts/jBars.js +++ b/src/charts/jBars.js @@ -85,7 +85,7 @@ export async function jBars (symbol, contract, from, to, res) { const mo = String(iDate.getUTCMonth()+1).padStart(2, '0'); // January is month 0 in Date object const date = is_daily_res ? String(iDate.getUTCDate()).padStart(2, '0') : ""; const yrmo = !is_single_res ? `-${yr}${mo}` : ""; - let baseURL = "https://alpha.dexorder.trade/ohlc/" + let baseURL = "https://beta.dexorder.trade/ohlc/" let chainId = useStore().chainId diff --git a/src/components/Faucet.vue b/src/components/Faucet.vue index 4150acc..c10f5f6 100644 --- a/src/components/Faucet.vue +++ b/src/components/Faucet.vue @@ -16,7 +16,10 @@ --> - +
+ + Get Sepolia ETH from the Arbitrum-Sepolia Faucet +
diff --git a/src/components/NeedsSigner.vue b/src/components/NeedsSigner.vue index 3c68620..7778989 100644 --- a/src/components/NeedsSigner.vue +++ b/src/components/NeedsSigner.vue @@ -1,17 +1,18 @@ diff --git a/src/layouts/default/AppBar.vue b/src/layouts/default/AppBar.vue index f1e410d..46ac0dc 100644 --- a/src/layouts/default/AppBar.vue +++ b/src/layouts/default/AppBar.vue @@ -6,7 +6,7 @@ dexorder - + diff --git a/src/store/store.js b/src/store/store.js index c949280..153b733 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -82,7 +82,6 @@ export const useStore = defineStore('app', ()=> { set(v) {_chainInfo.value=v} }) const chain = computed(() => !_chainId.value ? null : (_chainInfo.value[_chainId.value] || null)) - // this provider is for the app's chainId not the wallet's chainId. const providerRef = ref(null) const provider = computed(()=>providerRef.value) const vaultInitCodeHash = computed(() => !chain.value ? null : chain.value.vaultInitCodeHash)