Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Wallet portfolio #810

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5d13f9d
add basic wallet connection
janmichek Oct 25, 2023
bd91ef9
fix header styles
janmichek Oct 25, 2023
3f9afab
add basic connection UI
janmichek Oct 26, 2023
5d5f0c5
componentize UI
janmichek Oct 26, 2023
d40bb98
print basic account information
janmichek Oct 26, 2023
ab76025
fix scanning wallet
janmichek Oct 31, 2023
bc7128a
add hint
janmichek Oct 31, 2023
7f98917
add disconnect action
janmichek Oct 31, 2023
e46c0fd
display all account information
janmichek Oct 31, 2023
4e04e9b
create dropdown UI
janmichek Nov 1, 2023
2dbe581
fix header controls
janmichek Nov 1, 2023
ed88ec5
fix css selector
janmichek Nov 1, 2023
0e0a4c9
fix network id connection
janmichek Nov 1, 2023
d62b77f
extend button UI
janmichek Nov 1, 2023
a72bfeb
detect denied status
janmichek Nov 1, 2023
472e719
handle denied state
janmichek Nov 1, 2023
0064c93
fix imports
janmichek Nov 1, 2023
1cc7275
fix loading transitions
janmichek Nov 1, 2023
d561be6
fix connection controls
janmichek Nov 2, 2023
f985c39
change button style
janmichek Nov 2, 2023
f3c0b1b
remove comments
janmichek Nov 2, 2023
0e5e40a
remove unused code
janmichek Nov 2, 2023
946bfd1
update navigation when wallet changed
janmichek Nov 6, 2023
e5b8dac
add portfolio layout
janmichek Nov 7, 2023
2a9f16b
fix imports
janmichek Nov 7, 2023
a4e6a61
fix code style
janmichek Feb 5, 2024
40824d5
fixes after rebase
janmichek Feb 15, 2024
acad242
fixes after rebase
janmichek Mar 11, 2024
0f0d7fc
fix buttons
janmichek Mar 11, 2024
86d5fbc
fix code style
janmichek May 23, 2024
63695fe
fix code style
janmichek May 23, 2024
35a5ae3
Merge branch 'develop' into Wallet-portfolio
janmichek Jul 16, 2024
4af47df
fixes after rebase
janmichek Jul 16, 2024
96ccd71
extend testing timeout
janmichek Jul 17, 2024
9a7bdbb
fix code indentation
janmichek Jul 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ NUXT_PUBLIC_NETWORK_NAME=MAINNET
NUXT_PUBLIC_NETWORK_ID=ae_mainnet
NUXT_PUBLIC_ALTERNATIVE_NETWORK_URL=http://localhost:8081
NUXT_PUBLIC_ALTERNATIVE_NETWORK_NAME=TESTNET
NUXT_PUBLIC_NETWORK_ID="ae_mainnet"
NUXT_PUBLIC_AE_TOKEN_ID=ct_J3zBY8xxjsRr3QojETNw48Eb38fjvEuJKkQ6KzECvubvEcvCa
NUXT_PUBLIC_DEBUG_MODE=false
NUXT_PUBLIC_SH_DEX_CONTRACTS='ct_2mfj3FoZxnhkSw5RZMcP8BfPoB1QR4QiYGNCdkAvLZ1zfF6paW;ct_azbNZ1XrPjXfqBqbAh1ffLNTQ1sbnuUDFvJrXjYz7JQA1saQ3'
Expand Down
4 changes: 2 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from 'cypress'
import {defineConfig} from 'cypress'

export default defineConfig({
env: {
Expand All @@ -19,5 +19,5 @@ export default defineConfig({
},
viewportWidth: 1280,
viewportHeight: 720,
defaultCommandTimeout: 30000,
defaultCommandTimeout: 40000,
})
211 changes: 124 additions & 87 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,110 +4,147 @@ import {sentryVitePlugin} from '@sentry/vite-plugin'

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
srcDir: './src',
css: ['@/assets/styles/main.css'],
devServer: {
port: 8080,
srcDir: './src',
css: ['@/assets/styles/main.css'],
devServer: {
port: 8080,
},
nitro: {
routeRules: {
'/proxy/nodes': {proxy: 'http://138.68.22.27:3113/v2/debug/network', cors: true},
'/proxy/gate': {proxy: 'https://api.gateio.ws/api/v4/spot/tickers?currency_pair=AE_USDT', cors: true},
'/proxy/mexc': {proxy: 'https://api.mexc.com/api/v3/ticker/24hr?symbol=AEUSDT', cors: true},
'/proxy/coinw': {proxy: 'https://api.coinw.com/api/v1/public?command=returnTicker', cors: true},
},
nitro: {
routeRules: {
'/proxy/nodes': {proxy: 'http://138.68.22.27:3113/v2/debug/network', cors: true},
'/proxy/gate': {proxy: 'https://api.gateio.ws/api/v4/spot/tickers?currency_pair=AE_USDT', cors: true},
'/proxy/mexc': {proxy: 'https://api.mexc.com/api/v3/ticker/24hr?symbol=AEUSDT', cors: true},
'/proxy/coinw': {proxy: 'https://api.coinw.com/api/v1/public?command=returnTicker', cors: true},
},
},
modules: [
'@pinia/nuxt',
'@nuxtjs/plausible',
'nuxt-monaco-editor',
'nuxt-booster',
],
imports: {
dirs: ['./stores'],
},
plausible: {
apiHost: 'https://plausible.dev.service.aepps.com',
trackLocalhost: false,
},
appConfig: {
APP_VERSION: process.env.APP_VERSION,
},
runtimeConfig: {
public: {
SENTRY_DSN: process.env.SENTRY_DSN,
APP_DOMAIN: process.env.APP_DOMAIN,
MIDDLEWARE_URL: process.env.MIDDLEWARE_URL,
NODE_URL: process.env.NODE_URL,
WEBSOCKET_URL: process.env.WEBSOCKET_URL,
DEX_BACKEND_URL: process.env.DEX_BACKEND_URL,
NETWORK_NAME: process.env.NETWORK_NAME,
NETWORK_ID: process.env.NETWORK_ID,
ALTERNATIVE_NETWORK_URL: process.env.ALTERNATIVE_NETWORK_URL,
ALTERNATIVE_NETWORK_NAME: process.env.ALTERNATIVE_NETWORK_NAME,
AE_TOKEN_ID: process.env.AE_TOKEN_ID,
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
},
modules: [
'@pinia/nuxt',
'@nuxtjs/plausible',
'nuxt-monaco-editor',
'nuxt-booster',
],
imports: {
dirs: ['./stores'],
},

postcss: {
plugins: {
autoprefixer: {},
'@csstools/postcss-global-data': {
files: ['src/assets/styles/settings/_variables.css'],
},
'postcss-custom-media': {},
'postcss-import': {},
'postcss-nested': {},
},
plausible: {
apiHost: 'https://plausible.dev.service.aepps.com',
trackLocalhost: false,
apiHost: 'https://plausible.dev.service.aepps.com',
trackLocalhost: false,
},
appConfig: {
APP_VERSION: process.env.APP_VERSION,
APP_VERSION: process.env.APP_VERSION,
},
runtimeConfig: {
public: {
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
SENTRY_DSN: process.env.SENTRY_DSN,
APP_DOMAIN: process.env.APP_DOMAIN,
MIDDLEWARE_URL: process.env.MIDDLEWARE_URL,
NODE_URL: process.env.NODE_URL,
WEBSOCKET_URL: process.env.WEBSOCKET_URL,
DEX_BACKEND_URL: process.env.DEX_BACKEND_URL,
NETWORK_NAME: process.env.NETWORK_NAME,
ALTERNATIVE_NETWORK_URL: process.env.ALTERNATIVE_NETWORK_URL,
ALTERNATIVE_NETWORK_NAME: process.env.ALTERNATIVE_NETWORK_NAME,
AE_TOKEN_ID: process.env.AE_TOKEN_ID,
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
},
public: {
SENTRY_AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,
SENTRY_DSN: process.env.SENTRY_DSN,
APP_DOMAIN: process.env.APP_DOMAIN,
MIDDLEWARE_URL: process.env.MIDDLEWARE_URL,
NODE_URL: process.env.NODE_URL,
WEBSOCKET_URL: process.env.WEBSOCKET_URL,
DEX_BACKEND_URL: process.env.DEX_BACKEND_URL,
NETWORK_NAME: process.env.NETWORK_NAME,
ALTERNATIVE_NETWORK_URL: process.env.ALTERNATIVE_NETWORK_URL,
ALTERNATIVE_NETWORK_NAME: process.env.ALTERNATIVE_NETWORK_NAME,
AE_TOKEN_ID: process.env.AE_TOKEN_ID,
DEBUG_MODE: process.env.DEBUG_MODE,
CONTRACT_VERIFICATION_SERVICE_URL: process.env.CONTRACT_VERIFICATION_SERVICE_URL,
SH_DEX_CONTRACTS: process.env.SH_DEX_CONTRACTS?.split(';'),
},
},
postcss: {
plugins: {
autoprefixer: {},
'@csstools/postcss-global-data': {
files: ['src/assets/styles/settings/_variables.css'],
},
'postcss-custom-media': {},
'postcss-import': {},
'postcss-nested': {},
plugins: {
autoprefixer: {},
'@csstools/postcss-global-data': {
files: ['src/assets/styles/settings/_variables.css'],
},
'postcss-custom-media': {},
'postcss-import': {},
'postcss-nested': {},
},
},
sourcemap: true,
vite: {
build: {target: 'es2020'},
optimizeDeps: {
esbuildOptions: {target: 'es2020'},
},
define: {
__VUE_PROD_DEVTOOLS__: process.env.MODE !== 'production',
},
plugins: [
{
name: 'icon-svg-loader',
enforce: 'pre',
async load(path) {
if (!path.match(/icons\/.*.svg$/)) {
return
}
build: {target: 'es2020'},
optimizeDeps: {
esbuildOptions: {target: 'es2020'},
},
define: {
__VUE_PROD_DEVTOOLS__: process.env.MODE !== 'production',
},
plugins: [
{
name: 'icon-svg-loader',
enforce: 'pre',
async load(path) {
if (!path.match(/icons\/.*.svg$/)) {
return
}

const {code} = compileTemplate({
id: JSON.stringify(path),
filename: path,
source: await fs.readFile(path, 'utf-8'),
transformAssetUrls: false,
})
const {code} = compileTemplate({
id: JSON.stringify(path),
filename: path,
source: await fs.readFile(path, 'utf-8'),
transformAssetUrls: false,
})

return `${code}\nexport default { render: render }`
},
},
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sentry',
project: 'aescan-develop',
url: 'https://sentry.dev.service.aepps.com/',
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sentry',
project: 'aescan-production',
url: 'https://sentry.dev.service.aepps.com/',
}),
],
return `${code}\nexport default { render: render }`
},
},
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sentry',
project: 'aescan-develop',
url: 'https://sentry.dev.service.aepps.com/',
}),
sentryVitePlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'sentry',
project: 'aescan-production',
url: 'https://sentry.dev.service.aepps.com/',
}),
],
},
monacoEditor: {
locale: 'en',
componentName: {
codeEditor: 'MonacoEditor',
},
locale: 'en',
componentName: {
codeEditor: 'MonacoEditor',
},
},
}
})
25 changes: 23 additions & 2 deletions src/components/AccountTokensTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
v-for="token in accountTokens?.data"
:key="token.contractId">
<td>
<app-link :to="`/tokens/${token.contractId}`">
<app-link
:to="`/tokens/${token.contractId}`"
class="account-token-tables__link">
<token-symbol-icon
class="account-token-tables__icon"
:contract-id="token.contractId"/>
{{ token.tokenSymbol }}
</app-link>
</td>
Expand All @@ -55,7 +60,7 @@
{{ formatNumber(token.amount) }}
</td>
<td>
{{ token.value !== null ? `$${formatNumber(token.value,null,null, 7)}` : 'N/A' }}
{{ token.value !== null ? `$${formatNumber(token.value, null, null, 7)}` : 'N/A' }}
</td>
</tr>
</tbody>
Expand All @@ -66,6 +71,7 @@
import AppLink from '@/components/AppLink'
import { tokensHints } from '@/utils/hints/tokensHints'
import HintTooltip from '@/components/HintTooltip'
import TokenSymbolIcon from '~/components/TokenSymbolIcon'

defineProps({
accountTokens: {
Expand All @@ -74,3 +80,18 @@ defineProps({
},
})
</script>

<style scoped>
.account-token-tables {
&__icon {
width: 24px;
height: 24px;
margin-right: var(--space-1);
}

&__link {
display: inline-flex;
align-items: center;
}
}
</style>
19 changes: 18 additions & 1 deletion src/components/AccountTokensTableCondensed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
</app-tooltip>
</th>
<td class="account-tokens-table-condensed__data">
<app-link :to="`/tokens/${token.contractId}`">
<app-link
:to="`/tokens/${token.contractId}`"
class="account-tokens-table-condensed__link">
<token-symbol-icon
class="account-tokens-table-condensed__icon"
:contract-id="token.contractId"/>
{{ token.tokenSymbol }}
</app-link>
</td>
Expand Down Expand Up @@ -84,6 +89,7 @@ import AppLink from '@/components/AppLink'
import AppTooltip from '@/components/AppTooltip'
import ValueHashEllipsed from '@/components/ValueHashEllipsed'
import { tokensHints } from '@/utils/hints/tokensHints'
import TokenSymbolIcon from '~/components/TokenSymbolIcon'

defineProps({
accountTokens: {
Expand Down Expand Up @@ -116,5 +122,16 @@ defineProps({
&__data {
text-align: right;
}

&__icon {
width: 24px;
height: 24px;
margin-right: var(--space-1);
}

&__link {
display: inline-flex;
align-items: center;
}
}
</style>
4 changes: 2 additions & 2 deletions src/components/AppButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
v-if="!!to"
:to="to"
:target="target"
:disabled="disabled"
:class="[
'button',
variant ? `button--${variant}` : null,
size ? `button--${size}` : null,
]"
:disabled="disabled">
]">
<app-icon
v-if="iconName"
:name="iconName"
Expand Down
6 changes: 4 additions & 2 deletions src/components/AppDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<template>
<VMenu placement="bottom">
<slot/>
<VMenu placement="bottom">
<span>
<slot/>
</span>

<template #popper>
<slot name="menu"/>
Expand Down
Loading
Loading