alpha deployment
This commit is contained in:
@@ -8,6 +8,9 @@ const uniswapV3Addresses = {
|
||||
31337: {
|
||||
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||
},
|
||||
53261: {
|
||||
factory: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
|
||||
},
|
||||
}
|
||||
|
||||
export function uniswapV3PoolAddress(chainId, tokenAddrA, tokenAddrB, fee) {
|
||||
|
||||
@@ -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);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<ul>
|
||||
<li>Name: Dexorder Alpha</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>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -91,6 +91,7 @@ const arbitrumTokens = [
|
||||
const _knownTokens = {
|
||||
42161: arbitrumTokens,
|
||||
31337: arbitrumTokens,
|
||||
53261: [], // only show the two mock coins
|
||||
};
|
||||
|
||||
for( const chainId in _knownTokens ) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user