diff --git a/.env-alpha b/.env-alpha new file mode 100644 index 0000000..256e42b --- /dev/null +++ b/.env-alpha @@ -0,0 +1 @@ +VITE_WS_URL=wss://ws.alpha.dexorder.trade diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index c0ab49e..0000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM nginx:stable-alpine -RUN sed -i '1idaemon off;' /etc/nginx/nginx.conf -COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf -COPY dist /app -CMD ["nginx"] diff --git a/deploy/nginx.conf b/deploy/nginx.conf deleted file mode 100644 index b276136..0000000 --- a/deploy/nginx.conf +++ /dev/null @@ -1,25 +0,0 @@ -server { - listen 80 default_server; - - gzip on; - gzip_min_length 1000; - gzip_types text/plain text/xml application/javascript text/css; - - root /app; - - # normal routes - # serve given url and default to index.html if not found - # e.g. /, /user and /foo/bar will return index.html - location / { - add_header Cache-Control "no-store"; - try_files $uri $uri/index.html /index.html; - } - - # files - # for all routes matching a dot, check for files and return 404 if not found - # e.g. /file.js returns a 404 if not found - location ~ \.(?!html) { - add_header Cache-Control "public, max-age=2678400"; - try_files $uri =404; - } -} \ No newline at end of file diff --git a/k8s/le.yaml b/k8s/le.yaml deleted file mode 100644 index 086fa59..0000000 --- a/k8s/le.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: letsencrypt-prod -spec: - acme: - email: tim.olson.crypto@gmail.com - server: https://acme-v02.api.letsencrypt.org/directory - privateKeySecretRef: - name: letsencrypt-privkey-prod - solvers: - - http01: - ingress: - class: nginx diff --git a/src/blockchain/uniswap.js b/src/blockchain/uniswap.js index 63bfd71..17c0e50 100644 --- a/src/blockchain/uniswap.js +++ b/src/blockchain/uniswap.js @@ -8,6 +8,9 @@ const uniswapV3Addresses = { 31337: { factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984', }, + 53261: { + factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984', + }, } export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) { diff --git a/src/blockchain/wallet.js b/src/blockchain/wallet.js index e2a6a2c..648f154 100644 --- a/src/blockchain/wallet.js +++ b/src/blockchain/wallet.js @@ -44,11 +44,13 @@ function onAccountsChanged(accounts) { changeAccounts(accounts); } -export async function watchWallet() { - const chainId = (await new ethers.BrowserProvider(window.ethereum).getNetwork()).chainId - onChainChanged(chainId) - window.ethereum.on('chainChanged', onChainChanged); - window.ethereum.on('accountsChanged', onAccountsChanged); +export function detectChain() { + new ethers.BrowserProvider(window.ethereum).getNetwork().then((network)=>{ + const chainId = network.chainId + onChainChanged(chainId) + window.ethereum.on('chainChanged', onChainChanged); + window.ethereum.on('accountsChanged', onAccountsChanged); + }) } diff --git a/src/components/NeedsProvider.vue b/src/components/NeedsProvider.vue index 5bae2bd..12cb1d7 100644 --- a/src/components/NeedsProvider.vue +++ b/src/components/NeedsProvider.vue @@ -40,7 +40,7 @@ diff --git a/src/components/RoutePrice.vue b/src/components/RoutePrice.vue index 588aec2..4f3d430 100644 --- a/src/components/RoutePrice.vue +++ b/src/components/RoutePrice.vue @@ -6,6 +6,7 @@ import {useStore} from "@/store/store"; import {subPrices, unsubPrices} from "@/blockchain/prices.js"; import {computed, onBeforeUnmount} from "vue"; +import {FixedNumber} from "ethers"; const s = useStore() @@ -23,7 +24,8 @@ const price = computed(()=>{ if( !p ) return '' p = Number(p) // TODO: Temporary workaround. Better to fix reason for p being set to string. - console.log('pool price is',p) + console.log('pool price is',typeof p, p) + p = FixedNumber.fromString(p) if( props.inverted ) p = 1/p return p.toPrecision(props.precision) diff --git a/src/knownTokens.js b/src/knownTokens.js index 18d3da4..a66cbeb 100644 --- a/src/knownTokens.js +++ b/src/knownTokens.js @@ -91,6 +91,7 @@ const arbitrumTokens = [ const _knownTokens = { 42161: arbitrumTokens, 31337: arbitrumTokens, + 53261: [], // only show the two mock coins }; for( const chainId in _knownTokens ) { diff --git a/src/main.js b/src/main.js index 161bebd..2b3fe93 100644 --- a/src/main.js +++ b/src/main.js @@ -13,7 +13,7 @@ import { createApp } from 'vue' // Plugins import { registerPlugins } from '@/plugins' import '@/styles/style.scss' -import {watchWallet} from "@/blockchain/wallet.js"; +import {detectChain} from "@/blockchain/wallet.js"; import "./socket.js" BigInt.prototype.toJSON = function() { return this.toString() } @@ -22,4 +22,4 @@ const app = createApp(App) registerPlugins(app) app.mount('#app') -await watchWallet() +detectChain()