-
Notifications
You must be signed in to change notification settings - Fork 32
Wallet Demo #278
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
Open
onmax
wants to merge
61
commits into
nimiq:master
Choose a base branch
from
onmax:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Wallet Demo #278
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ions with error handling
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ypes and state management
…ions Co-authored-by: maximogarciamtnez <maximogarciamtnez@gmail.com>
…s, update demo flow paths and message types
Simplifies iframe communication by using consistent message types: - demo:ready (initialization) - action:change (state sync) - action:open-*-modal (bidirectional modal opening) - action:close-modal (modal closing) Removes playground test utilities that were not being used. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Reduce btcInitialBalance from 0.0025 BTC to 0.00025 BTC to show a more realistic amount for the demo user who has been spending crypto while traveling the world.
- Update enableSellAndSwapModals function to target both send and swap modal footer buttons - Use querySelectorAll with forEach to handle multiple modal types - Ensures swap modal "Confirm" button is enabled for fake swaps in demo mode - Maintains existing functionality for hiding sync messages
The hardcoded change output value of 1000000 satoshis (0.01 BTC) per outgoing transaction was creating an unrealistic total balance of ~0.1 BTC in the demo. Reduced to 100000 satoshis (0.001 BTC) per transaction to create a more realistic total BTC balance of ~0.01 BTC for the demo user.
Avoid NavigationDuplicated errors when clicking hamburger menu on mobile/tablet by checking current route before navigation and handling errors gracefully.
Closed
- Delete src/lib/Demo.ts compatibility shim - Update imports to use src/lib/demo - Remove hot-reload duplicate-init and route dedupe in demo/index.ts - Keep service-worker update behavior unchanged (non-demo)
- Wrap long template/script lines to satisfy max-len - Expose RouteName to template to avoid unused-var warning - Remove unused variable in demo index - Re-run lint:fix to ensure clean state
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Demo Mode for Nimiq Wallet
https://nimiq-wallet-demo.je-cf9.workers.dev/
Overview
This PR introduces a comprehensive demo environment that allows users to experience all major wallet features without connecting to real blockchain networks or risking actual funds. Users interact with realistic fake data while being clearly informed they're in a demo environment.
TODOs before merging
src/config/config.local.ts
src/config/config.testnet.ts
src/lib/Constants.ts
Quick Start
New Build Commands
Activation Methods
Development Mode:
?demo
to any wallet URL (development only)config.demo.enabled = true
Production Demo:
yarn build:demo
for production demo deploymentconfig.demo.enabled = 'domain.com'
for specific domainsDemo Features
🎭 Realistic Experience
🛡️ Safety First
🔄 Supported Demo Flows
Technical Implementation
🏗️ Architecture
src/lib/Demo.ts
(~2000 lines)src/main-demo.ts
for demo buildsDemoHubApi
replaces real Hub interactions⚙️ Build System
build=demo
(development) /build=demo-production
(production)demo-YYYY-MM-DD
format for demo builds🎨 UI Enhancements
DemoModalBuy.vue
andDemoModalFallback.vue
📡 iframe Communication
Ready for nimiq.com integration with bidirectional messaging:
Development Benefits
🧪 Enhanced QA
🔧 Developer Experience
Files Changed
Core Implementation
src/lib/Demo.ts
- Main demo system (new)src/main-demo.ts
- Demo entry point (new)src/hub.ts
- Mock Hub API integrationvue.config.js
- Build system configurationDemo Components
src/components/modals/demos/DemoModalBuy.vue
(new)src/components/modals/demos/DemoModalFallback.vue
(new)Configuration & Scripts
package.json
- New demo build scripts🚀 Ready for Production: This feature enables the nimiq.com/wallet demo page, providing users with a safe, educational introduction to the Nimiq Wallet ecosystem.