Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ac0faf8
feat(demo): integrate demo mode
onmax Feb 26, 2025
4abf238
docs(demo): update README to clarify demo mode usage and Nimiq Hub re…
onmax Mar 5, 2025
a757134
chore(demo): intercept and return swap api results
onmax Mar 5, 2025
c7a763b
feat(demo): added swap animation
Albermonte Mar 10, 2025
34c75ba
chore(demo): streamlined transactions functions
onmax Mar 10, 2025
9346005
chore(demo): linter
onmax Mar 10, 2025
b62a75b
fix(demo): swap not working after bug introduced in refactor
Albermonte Mar 10, 2025
a4d3ddc
feat(demo): enable sell and swap modals in demo mode
onmax Mar 11, 2025
b9c06c1
chore(demo): only allow nim-btc swaps
onmax Mar 11, 2025
7641cba
chore(demo): lint
onmax Mar 11, 2025
db88ea2
chore(demo): reverted changes in BuyOptionsModal. Optimized MutationO…
onmax Mar 11, 2025
3f5d8c4
refactor(demo): moved demo to lib
onmax Mar 11, 2025
a23e415
feat(demo): add balance update functions for NIM and BTC transactions
onmax Mar 11, 2025
4cf1209
feat(demo): enhance balance update functions for NIM and BTC transact…
onmax Mar 12, 2025
322eb1d
feat(demo): implement additional error handling for balance update fu…
onmax Mar 12, 2025
76bb21f
fix(demo): correct amount parsing and update balance assignment in st…
onmax Mar 12, 2025
29b8ab3
docs: updated wording
onmax Mar 27, 2025
86a66ec
feat(demo): add demo mode notice in sidebar with tooltip information
onmax Apr 15, 2025
f4830f2
feat: improved demo fallback modal
onmax Apr 15, 2025
f02abf3
chore: speed up swap process
onmax Apr 15, 2025
08b9740
chore(demo): obfuscate addresses
onmax Apr 15, 2025
84a9b73
chore(demo): handle receive modal
onmax Apr 15, 2025
9ea22a8
fix: keep `demo` query after each navigation
onmax Apr 17, 2025
3867fd6
feat(demo): improved buy flow
onmax Apr 17, 2025
0f5da85
Merge branch 'master' into demo
onmax May 15, 2025
9a8574c
fix: rename `isDemoEnabled` to `isDemoActive` for consistency
onmax May 15, 2025
1edee3f
lint
onmax May 15, 2025
256fcb5
feat(demo): add demo mode configuration and initialization logic
onmax May 15, 2025
264e250
lint
onmax May 15, 2025
a25e044
fix(config): disable polygon network by default
onmax May 15, 2025
f185259
feat(demo): enhance demo build configuration and streamline initializ…
onmax Jul 8, 2025
90a6fa2
chore(demo): refactor demo module structure and enhance functionality…
onmax Jul 8, 2025
9e34166
Merge pull request #1 from onmax/demo
onmax Jul 8, 2025
0ad9ca4
chore(demo): fix build
onmax Jul 8, 2025
9219eec
feat(demo): extend wallet playground functionality with new message t…
onmax Jul 8, 2025
a616b8e
feat(demo): add wrangler configuration and enhance internationalizati…
onmax Jul 28, 2025
0d86008
feat(demo): add wrangler configuration and comment out unused transac…
onmax Aug 6, 2025
03b5dc2
Update demo build detection to support multiple demo build configurat…
cursoragent Aug 6, 2025
a34f799
refactor(demo): simplify demo build detection logic
onmax Aug 6, 2025
ed16f34
refactor(demo): optimize demo build detection logic and improve reada…
onmax Aug 6, 2025
a5ca7ac
refactor(demo): adjust CI environment handling in demo build detectio…
onmax Aug 6, 2025
46f82f0
docs: add warning about out-of-sync PR in README
onmax Aug 6, 2025
0717914
feat(demo): enable Polygon network in local and testnet configuration…
onmax Aug 27, 2025
939c0f3
Merge remote-tracking branch 'upstream/master'
onmax Aug 27, 2025
83334de
chore(demo): remove unnecessary blank line in index.ts
onmax Aug 27, 2025
1d7f29b
refactor(demo): standardize message format and remove unused test code
onmax Aug 27, 2025
5bbfcad
fix(demo): remove extra blank line to pass linting
onmax Aug 27, 2025
50b1d7c
feat(demo): make Bitcoin balance more realistic
onmax Aug 27, 2025
df6e7f1
fix(demo): enable swap modal confirmation button in demo mode
onmax Aug 27, 2025
8f87fd7
fix(demo): reduce hardcoded BTC change output to match realistic balance
onmax Aug 27, 2025
34f17d6
fix(demo): prevent navigation duplication error on mobile hamburger menu
onmax Aug 27, 2025
9e48072
fix(demo): improve random Polygon address generation for Ethereum com…
onmax Aug 29, 2025
81f9f05
remove deprecated demo config property
onmax Sep 1, 2025
e807c80
refactor(demo): improve iframe communication & add test
onmax Sep 1, 2025
d296810
chore: fix demo
onmax Sep 1, 2025
0f39770
demo: remove backward compat shim and HMR guards; update imports
onmax Sep 2, 2025
96437e5
lint: apply fixes and resolve ESLint issues
onmax Sep 2, 2025
51ea99e
fix: demo mode improvements and router fixes
onmax Sep 2, 2025
e180de8
fix(demo): improve iframe message logging by filtering expected messa…
onmax Sep 2, 2025
dff5505
launch network
onmax Sep 2, 2025
e0129ed
problematic yarn
onmax Sep 2, 2025
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Nimiq Wallet

> [!WARNING]
> There is an Open PR: https://github.com/nimiq/wallet/pull/263 that it is out of sync already.

## Project setup
```
yarn install
Expand All @@ -10,7 +13,12 @@ yarn install
yarn serve
```

> You will also need to run the [Nimiq Hub](https://github.com/nimiq/hub#contribute) and [Nimiq Keyguard](https://github.com/nimiq/keyguard/#development) in development, too.
If you need to interact with a real account and data, then you will also need to run the [Nimiq Hub](https://github.com/nimiq/hub#contribute) and [Nimiq Keyguard](https://github.com/nimiq/keyguard/#development) in development, too.

For demo mode with simulated accounts and transactions, use:
```
yarn serve:demo
```

### Compiles and minifies for production
```
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"packageManager": "yarn@1.22.22",
"scripts": {
"serve": "yarn pre && yarn vue-cli-service serve --port 8081",
"serve:demo": "yarn pre && build=demo yarn vue-cli-service serve --port 8081",
"build": "yarn pre && yarn vue-cli-service build",
"build:demo": "yarn pre && build=demo NODE_ENV=production yarn vue-cli-service build",
"build:demo-production": "yarn pre && build=demo-production NODE_ENV=production yarn vue-cli-service build",
"lint": "vue-cli-service lint --no-fix",
"lint:fix": "vue-cli-service lint",
"build:bitcoinjs": "yarn --silent browserify bitcoinjs-parts.js -p common-shakeify -s BitcoinJS | yarn terser --compress --mangle --source-map --output public/bitcoin/BitcoinJS.min.js",
Expand Down
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import { nextTick } from '@/lib/nextTick';
import Sidebar from './components/layouts/Sidebar.vue';
import SwapNotification from './components/swap/SwapNotification.vue';
import UpdateNotification from './components/UpdateNotification.vue';
import router, { provideRouter } from './router';
import router, { provideRouter, RouteName } from './router';
import { useAccountStore } from './stores/Account';
import { useSettingsStore } from './stores/Settings';
import { useWindowSize } from './composables/useWindowSize';
Expand Down Expand Up @@ -110,7 +110,7 @@ export default defineComponent({
await router.push({ name: router.currentRoute.name!, query: { sidebar: 'true' } });
} else if (currentXPosition <= transactionsBarrier && (initialXPosition) > transactionsBarrier) {
// Go to transactions
if (router.currentRoute.name === 'root') {
if (router.currentRoute.name === RouteName.Root) {
await router.push('/transactions');
}
} else if (
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccountMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<script lang="ts">
import { defineComponent, computed } from '@vue/composition-api';
import { Identicon, MenuDotsIcon } from '@nimiq/vue-components';
import { useRouter } from '@/router';
import { useRouter, RouteName } from '@/router';

import LoginFileIcon from './icons/LoginFileIcon.vue';
import LedgerIcon from './icons/LedgerIcon.vue';
Expand Down Expand Up @@ -56,7 +56,7 @@ export default defineComponent({
&& addressState.addressInfos[activeAccountInfo.value.addresses[0]]);

function goToAccount(testForMenuOpening = true) {
if (testForMenuOpening && router.currentRoute.name === 'root') {
if (testForMenuOpening && router.currentRoute.name === RouteName.Root) {
openMenu();
return;
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/AddressList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { useAccountStore } from '../stores/Account';
import { useBtcAddressStore } from '../stores/BtcAddress';
import { usePolygonAddressStore } from '../stores/PolygonAddress';
import { CryptoCurrency } from '../lib/Constants';
import router from '../router';
import router, { RouteName } from '../router';
import { useSettingsStore } from '../stores/Settings';
import { useAccountSettingsStore } from '../stores/AccountSettings';
import { useStakingStore } from '../stores/Staking';
Expand Down Expand Up @@ -142,7 +142,12 @@ export default defineComponent({
watch(activeAddress, () => activeAddress.value && adjustBackgroundOffsetAndScale(activeAddress.value));
/* Update the .active-box after the decimals setting is changed */
router.afterEach((to, from) => {
if (from.name === 'settings' && from.query.sidebar && to.name === 'root' && activeAddress.value) {
if (
from.name === RouteName.Settings
&& from.query.sidebar
&& to.name === RouteName.Root
&& activeAddress.value
) {
nextTick(() =>
activeAddress.value && adjustBackgroundOffsetAndScale(activeAddress.value),
);
Expand Down
148 changes: 148 additions & 0 deletions src/components/icons/ThreeLoginFiles.vue

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/components/layouts/AccountOverview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
</div>

<div class="mobile-menu-bar flex-row">
<button class="reset menu-button" @click="$router.push({name: 'root', query: {sidebar: 'true'}})">
<button
class="reset menu-button"
@click="$router.push({ name: RouteName.Root, query: { sidebar: 'true' } })"
>
<MenuIcon/>
<AttentionDot v-if="updateAvailable"/>
</button>
Expand Down
12 changes: 9 additions & 3 deletions src/components/layouts/Network.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<template>
<div class="network nq-blue-bg" :class="{'no-footer': !$config.enableBitcoin && !$config.polygon.enabled }">
<div class="menu-bar full-width flex-row">
<button class="reset menu-button"
@click="$router.push({ name: 'network', query: { sidebar: !router.currentRoute.query.sidebar } })">
<button
class="reset menu-button"
@click="$router.push({
name: RouteName.Network,
query: { sidebar: !router.currentRoute.query.sidebar },
})"
>
<MenuIcon/>
<AttentionDot v-if="updateAvailable"/>
</button>
Expand Down Expand Up @@ -104,7 +109,7 @@ import MenuIcon from '../icons/MenuIcon.vue';
import NetworkInfoModal from '../modals/NetworkInfoModal.vue';
import AttentionDot from '../AttentionDot.vue';
import FiatConvertedAmount from '../FiatConvertedAmount.vue';
import router from '../../router';
import router, { RouteName } from '../../router';

const LOCALSTORAGE_KEY = 'network-info-dismissed';

Expand Down Expand Up @@ -197,6 +202,7 @@ export default defineComponent({
btcFee,
polygonFee,
router,
RouteName,
stablecoin,
};
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/layouts/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="settings flex-row">
<div class="mobile-menu-bar flex-row">
<button class="reset menu-button" @click="$router.push({name: 'settings', query: {sidebar: true}})">
<button class="reset menu-button" @click="$router.push({name: RouteName.Settings, query: {sidebar: true}})">
<MenuIcon/>
</button>

Expand Down
36 changes: 30 additions & 6 deletions src/components/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="sidebar padding flex-column">
<div v-if="isTestnet" class="testnet-notice flex-row">
<div v-if="isTestnet" class="environment-notice flex-row">
<StreetconeIcon/>
<span class="nq-label">{{ $t('PoS Testnet') }}</span>
<div class="flex-grow"></div>
Expand All @@ -20,6 +20,26 @@
</Tooltip>
</div>

<div v-if="isDemoActive " class="environment-notice demo-notice flex-row">
<StreetconeIcon/>
<span class="nq-label">{{ $t('Demo mode') }}</span>
<div class="flex-grow"></div>
<Tooltip preferredPosition="bottom left"
:container="$parent"
theme="inverse"
:styles="{ transform: 'translate(0.5rem, 2rem)' }"
ref="demoTooltip"
>
<template #trigger>
<InfoCircleIcon/>
</template>
<template #default>
<p>{{ $t('Experience the Nimiq Wallet risk-free.' ) }}</p>
<p>{{ $t('Explore and learn how it all works, safely and without real assets.') }}</p>
</template>
</Tooltip>
</div>

<header class="logo" @click="resetState">
<span class="nq-icon nimiq-logo"></span>
<span class="logo-wordmark">Nimiq</span>
Expand Down Expand Up @@ -165,20 +185,20 @@
<div class="flex-grow"></div>

<AccountMenu
:class="{'active': $route.name === 'root'}"
:class="{'active': $route.name === RouteName.Root}"
@click="navigateTo('/')"/>

<button
class="network reset flex-row"
:class="{'active': $route.name === 'network'}"
:class="{'active': $route.name === RouteName.Network}"
@click="navigateTo('/network')"
>
<ConsensusIcon/>
<span class="label">{{ $t('Network') }}</span>
</button>
<button
class="settings reset flex-row"
:class="{'active': $route.name === 'settings'}"
:class="{'active': $route.name === RouteName.Settings}"
@click="navigateTo('/settings')"
>
<GearIcon/>
Expand All @@ -193,6 +213,7 @@ import { defineComponent, ref, computed } from '@vue/composition-api';
import { SwapAsset } from '@nimiq/fastspot-api';
import { GearIcon, Tooltip, InfoCircleIcon } from '@nimiq/vue-components';
import { RouteName, useRouter } from '@/router';
import { checkIfDemoIsActive } from '@/lib/demo';
import AnnouncementBox from '../AnnouncementBox.vue';
import AccountMenu from '../AccountMenu.vue';
import PriceChart, { TimeRange } from '../PriceChart.vue';
Expand Down Expand Up @@ -359,8 +380,11 @@ export default defineComponent({
: null;
});

const isDemoActive = checkIfDemoIsActive();

return {
CryptoCurrency,
RouteName,
navigateTo,
resetState,
isTestnet,
Expand All @@ -378,13 +402,13 @@ export default defineComponent({
updateAvailable,
hideTooltips,
openModal,
RouteName,
SellProvider,
enabledSellProviders,
sellEnabled,
openSellModal,
nimSellOptions,
activeCurrency,
isDemoActive,
};
},
components: {
Expand Down Expand Up @@ -424,7 +448,7 @@ $balance-distribution-display-breakpoint: 450px;
padding-bottom: max(var(--padding-bottom), env(safe-area-inset-bottom));
}

.testnet-notice {
.environment-notice {
align-items: center;
width: calc(100% + calc(2 * var(--padding-sides)));
margin: calc(-1 * var(--padding-top)) calc(-1 * var(--padding-sides)) var(--padding-top);
Expand Down
Loading
Loading