diff --git a/index.html b/index.html index db3f1bd..7f15b18 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,16 @@ + + + +
diff --git a/public/dexorder_full_darkmode.svg b/public/logo/dexorder_full_darkmode.svg similarity index 100% rename from public/dexorder_full_darkmode.svg rename to public/logo/dexorder_full_darkmode.svg diff --git a/public/dexorder_full_lightmode.svg b/public/logo/dexorder_full_lightmode.svg similarity index 100% rename from public/dexorder_full_lightmode.svg rename to public/logo/dexorder_full_lightmode.svg diff --git a/public/logo/ico_black_clip.png b/public/logo/ico_black_clip.png new file mode 100644 index 0000000..e79a82d Binary files /dev/null and b/public/logo/ico_black_clip.png differ diff --git a/public/logo/ico_black_fill.png b/public/logo/ico_black_fill.png new file mode 100644 index 0000000..280e1eb Binary files /dev/null and b/public/logo/ico_black_fill.png differ diff --git a/public/logo/ico_green_clip.png b/public/logo/ico_green_clip.png new file mode 100644 index 0000000..620cf08 Binary files /dev/null and b/public/logo/ico_green_clip.png differ diff --git a/public/logo/ico_green_fill.png b/public/logo/ico_green_fill.png new file mode 100644 index 0000000..48f2332 Binary files /dev/null and b/public/logo/ico_green_fill.png differ diff --git a/public/logo/ico_white_clip.png b/public/logo/ico_white_clip.png new file mode 100644 index 0000000..1bde17a Binary files /dev/null and b/public/logo/ico_white_clip.png differ diff --git a/public/logo/ico_white_fill.png b/public/logo/ico_white_fill.png new file mode 100644 index 0000000..8d45b0c Binary files /dev/null and b/public/logo/ico_white_fill.png differ diff --git a/public/uniswap-logo.svg b/public/uniswap-logo.svg new file mode 100644 index 0000000..bbe75a0 --- /dev/null +++ b/public/uniswap-logo.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/App.vue b/src/App.vue index 5f9479a..7ae54cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,17 @@ diff --git a/src/blockchain/wallet.js b/src/blockchain/wallet.js index b5abd31..46ef44f 100644 --- a/src/blockchain/wallet.js +++ b/src/blockchain/wallet.js @@ -619,3 +619,26 @@ export async function addNetwork(chainId) { }); } +export async function addNetworkAndConnectWallet(chainId) { + try { + await switchChain(chainId) + } catch (e) { + if (e.code === 4001) { + // explicit user rejection + return + } else if (e.code === 4902) { + try { + await addNetwork(chainId) + } catch (e) { + console.log(`Could not add network ${chainId}`) + } + } else + console.log('switchChain() failure', e) + } + try { + await connectWallet(chainId) + } catch (e) { + if (e.code !== 4001) + console.log('connectWallet() failed', e) + } +} \ No newline at end of file diff --git a/src/charts/chart.js b/src/charts/chart.js index 0f2321c..a9d1eb1 100644 --- a/src/charts/chart.js +++ b/src/charts/chart.js @@ -85,10 +85,14 @@ const subscribeEvents = [ let poolButtonTextElement = null -export function initFeeDropdown() { +function initFeeDropdown() { const button = widget.createButton() button.setAttribute('title', 'See Pool Info and Choose Fee'); - button.addEventListener('click', function() { co.showPoolSelection = true }); + button.addEventListener('click', function () { + co.showPoolSelection = true + }); + button.id = 'pool-button' + button.style.height = '34px'; button.style.display = 'flex'; button.style.alignItems = 'center'; @@ -98,13 +102,25 @@ export function initFeeDropdown() { button.addEventListener('mouseout', () => { button.style.backgroundColor = ''; }); - button.id = 'pool-button' button.style.margin = '2px 0'; button.style.borderRadius = '4px'; button.classList.add('pool-button') + let img = document.createElement('img'); + img.src = '/arbitrum-logo.svg'; + img.style.width = '1em'; + img.style.marginRight = '0.2em'; + button.appendChild(img); + + img = document.createElement('img'); + img.src = '/uniswap-logo.svg'; + img.style.height = '1.25em'; + img.style.marginRight = '0.2em'; + img.style.backgroundColor = 'white'; + img.style.borderRadius = '50%'; + button.appendChild(img); + const span = document.createElement('span'); - span.textContent = 'Pool'; span.style.marginY = 'auto'; button.appendChild(span); poolButtonTextElement = span @@ -115,7 +131,7 @@ export function initFeeDropdown() { export function updateFeeDropdown() { if (poolButtonTextElement===null) return const symbolItem = useChartOrderStore().selectedSymbol - let text = 'Pool ' + let text = '' text += (symbolItem.fee / 10000).toFixed(2) + '%' const index = symbolItem.feeGroup.findIndex((p) => p[1] === symbolItem.fee) if (symbolItem.liquiditySymbol) { @@ -128,6 +144,10 @@ export function updateFeeDropdown() { poolButtonTextElement.textContent = text } +export function initTVButtons() { + initFeeDropdown(); +} + export function initWidget(el) { const symbol = prefs.selectedTicker === null ? 'default' : prefs.selectedTicker const interval = prefs.selectedTimeframe === null ? '15' : prefs.selectedTimeframe @@ -166,7 +186,7 @@ export function initWidget(el) { widget.subscribe('onSelectedLineToolChanged', onSelectedLineToolChanged) widget.subscribe('mouse_down', mouseDown) widget.subscribe('mouse_up', mouseUp) - widget.headerReady().then(()=>initFeeDropdown()) + widget.headerReady().then(()=>initTVButtons()) widget.onChartReady(initChart) console.log('tv widget initialized') } diff --git a/src/components/LadderOrder.vue b/src/components/LadderOrder.vue index 2595843..a360444 100644 --- a/src/components/LadderOrder.vue +++ b/src/components/LadderOrder.vue @@ -6,7 +6,7 @@ v-model="os.tranches" :rules="[validateRequired,validateTranches]"> - diff --git a/src/components/Logo.vue b/src/components/Logo.vue index b1f10df..7b9e045 100644 --- a/src/components/Logo.vue +++ b/src/components/Logo.vue @@ -1,19 +1,31 @@ \ No newline at end of file diff --git a/src/components/PoolSelectionDialog.vue b/src/components/PoolSelectionDialog.vue index c3094c0..840e007 100644 --- a/src/components/PoolSelectionDialog.vue +++ b/src/components/PoolSelectionDialog.vue @@ -2,6 +2,12 @@ +
+ Arbitrum One +
+
+ Uniswap v3 +
diff --git a/src/components/WelcomeDialog.vue b/src/components/WelcomeDialog.vue new file mode 100644 index 0000000..8e6490d --- /dev/null +++ b/src/components/WelcomeDialog.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/src/components/chart/BuilderPanel.vue b/src/components/chart/BuilderPanel.vue index c39d3f6..de659f7 100644 --- a/src/components/chart/BuilderPanel.vue +++ b/src/components/chart/BuilderPanel.vue @@ -1,20 +1,32 @@ + \ No newline at end of file diff --git a/src/components/chart/ChartPlaceOrder.vue b/src/components/chart/ChartPlaceOrder.vue index 2cfe237..02871a3 100644 --- a/src/components/chart/ChartPlaceOrder.vue +++ b/src/components/chart/ChartPlaceOrder.vue @@ -65,6 +65,7 @@ import ToolbarPane from "@/components/chart/ToolbarPane.vue"; import NeedsChart from "@/components/NeedsChart.vue"; import {PlaceOrderTransaction} from "@/blockchain/transaction.js"; import {errorSuggestsMissingVault} from "@/misc.js"; +import {track} from "@/track.js"; const s = useStore() const co = useChartOrderStore() @@ -148,6 +149,7 @@ watchEffect(()=>{ let built = [] async function placeOrder() { + track('place_order') const chartOrders = co.orders; const allWarns = [] built = [] @@ -187,7 +189,7 @@ async function doPlaceOrder() { else { s.creatingVault = false oldFailed.bind(this)(e) - placementError.value = true + placementError.value = e.info?.error?.code !== 4001 } } tx.submit() // this assigns the tx to walletStore.transaction diff --git a/src/components/chart/DCABuilder.vue b/src/components/chart/DCABuilder.vue index f785f51..d12365e 100644 --- a/src/components/chart/DCABuilder.vue +++ b/src/components/chart/DCABuilder.vue @@ -1,11 +1,9 @@
Pool