alpha deployment
This commit is contained in:
1
.env-alpha
Normal file
1
.env-alpha
Normal file
@@ -0,0 +1 @@
|
|||||||
|
VITE_WS_URL=wss://ws.alpha.dexorder.trade
|
||||||
@@ -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"]
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
15
k8s/le.yaml
15
k8s/le.yaml
@@ -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
|
|
||||||
@@ -8,6 +8,9 @@ const uniswapV3Addresses = {
|
|||||||
31337: {
|
31337: {
|
||||||
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||||
},
|
},
|
||||||
|
53261: {
|
||||||
|
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) {
|
export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) {
|
||||||
|
|||||||
@@ -44,11 +44,13 @@ function onAccountsChanged(accounts) {
|
|||||||
changeAccounts(accounts);
|
changeAccounts(accounts);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function watchWallet() {
|
export function detectChain() {
|
||||||
const chainId = (await new ethers.BrowserProvider(window.ethereum).getNetwork()).chainId
|
new ethers.BrowserProvider(window.ethereum).getNetwork().then((network)=>{
|
||||||
|
const chainId = network.chainId
|
||||||
onChainChanged(chainId)
|
onChainChanged(chainId)
|
||||||
window.ethereum.on('chainChanged', onChainChanged);
|
window.ethereum.on('chainChanged', onChainChanged);
|
||||||
window.ethereum.on('accountsChanged', onAccountsChanged);
|
window.ethereum.on('accountsChanged', onAccountsChanged);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Name: Dexorder Alpha</li>
|
<li>Name: Dexorder Alpha</li>
|
||||||
<li>New RPC URL: https://rpc.alpha.dexorder.trade</li>
|
<li>New RPC URL: https://rpc.alpha.dexorder.trade</li>
|
||||||
<li>Chain ID: 31337</li>
|
<li>Chain ID: 53261</li>
|
||||||
<li>Currency Symbol: TETH</li>
|
<li>Currency Symbol: TETH</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
import {useStore} from "@/store/store";
|
import {useStore} from "@/store/store";
|
||||||
import {subPrices, unsubPrices} from "@/blockchain/prices.js";
|
import {subPrices, unsubPrices} from "@/blockchain/prices.js";
|
||||||
import {computed, onBeforeUnmount} from "vue";
|
import {computed, onBeforeUnmount} from "vue";
|
||||||
|
import {FixedNumber} from "ethers";
|
||||||
|
|
||||||
const s = useStore()
|
const s = useStore()
|
||||||
|
|
||||||
@@ -23,7 +24,8 @@ const price = computed(()=>{
|
|||||||
if( !p )
|
if( !p )
|
||||||
return ''
|
return ''
|
||||||
p = Number(p) // TODO: Temporary workaround. Better to fix reason for p being set to string.
|
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 )
|
if( props.inverted )
|
||||||
p = 1/p
|
p = 1/p
|
||||||
return p.toPrecision(props.precision)
|
return p.toPrecision(props.precision)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ const arbitrumTokens = [
|
|||||||
const _knownTokens = {
|
const _knownTokens = {
|
||||||
42161: arbitrumTokens,
|
42161: arbitrumTokens,
|
||||||
31337: arbitrumTokens,
|
31337: arbitrumTokens,
|
||||||
|
53261: [], // only show the two mock coins
|
||||||
};
|
};
|
||||||
|
|
||||||
for( const chainId in _knownTokens ) {
|
for( const chainId in _knownTokens ) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { createApp } from 'vue'
|
|||||||
// Plugins
|
// Plugins
|
||||||
import { registerPlugins } from '@/plugins'
|
import { registerPlugins } from '@/plugins'
|
||||||
import '@/styles/style.scss'
|
import '@/styles/style.scss'
|
||||||
import {watchWallet} from "@/blockchain/wallet.js";
|
import {detectChain} from "@/blockchain/wallet.js";
|
||||||
import "./socket.js"
|
import "./socket.js"
|
||||||
|
|
||||||
BigInt.prototype.toJSON = function() { return this.toString() }
|
BigInt.prototype.toJSON = function() { return this.toString() }
|
||||||
@@ -22,4 +22,4 @@ const app = createApp(App)
|
|||||||
registerPlugins(app)
|
registerPlugins(app)
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
await watchWallet()
|
detectChain()
|
||||||
|
|||||||
Reference in New Issue
Block a user