complete store refactor; moved form inputs into store; refactored components out of TimedOrderEntry

This commit is contained in:
Tim Olson
2023-11-25 16:21:42 -04:00
parent c3f05deff1
commit 094108d806
13 changed files with 192 additions and 174 deletions

View File

@@ -17,18 +17,10 @@ socket.on('disconnect', () => {
socket.on('welcome', async (data) => {
console.log('welcome', data)
const mockCoins = data['chainInfo'][31337].mockCoins
console.log('coin order:',
mockCoins[1] > mockCoins[0] ? "coin1 > coin0" : "coin0 > coin1 (inverted)",
mockCoins)
const s = useStore()
// todo put the vaultInitCodeHash into the chainInfo
s.chainInfo = data.chainInfo
s.vaultInitCodeHash = data.vaultInitCodeHash
// set default tokens in pair choice dropdown
if( s.tokenA === null && Object.values(s.tokens).length >= 1 )
s.tokenA = Object.values(s.tokens)[0]
if( s.tokenB === null && Object.values(s.tokens).length >= 2 )
s.tokenB = Object.values(s.tokens)[1]
const p = new ethers.BrowserProvider(window.ethereum)
const network = await p.getNetwork()
if (network !== null)