Skip to content

cardano-wasm demo: multi-wallet management - #1270

Open
palas wants to merge 2 commits into
masterfrom
wasm-demo-wallet-management
Open

cardano-wasm demo: multi-wallet management#1270
palas wants to merge 2 commits into
masterfrom
wasm-demo-wallet-management

Conversation

@palas

@palas palas commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Context

This is a follow up to: #1257

It adds the initial functionalities of the demo:

  • generate stake-enabled wallets; restore from bech32 signing keys
  • editable alias, collapsible cards, keys & hashes (blurred secrets), copy address, forget dialog
  • mainnet/preprod/preview switch with wasm address re-derivation
  • console panel (capped, scroll pinned to newest) and toast
  • module skeleton: Types, State, Update, View, Wasm, Net, Format, Ports

How to trust this PR

  • Diff is entirely cardano-wasm/demo/ + a changelog fragment; CI already compiles it (elm make --optimize) and checks elm-format.
  • To try it: serve this PR's cardano-wasm-demo artifact over http and click through.
  • No network requests, no persistence; all key/address work is cardano-wasm calls (see web/ports.js).
  • Will add elm-tests in a future PR.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

- generate stake-enabled wallets; restore from bech32 signing keys
- editable alias, collapsible cards, keys & hashes (blurred secrets),
  copy address, forget dialog
- mainnet/preprod/preview switch with wasm address re-derivation
- console panel (capped, scroll pinned to newest) and toast
- module skeleton: Types, State, Update, View, Wasm, Net, Format, Ports
@palas palas self-assigned this Jul 28, 2026
Copilot AI review requested due to automatic review settings July 28, 2026 01:26
@palas
palas marked this pull request as draft July 28, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the first “real” functionality to the cardano-wasm browser demo by wiring Elm UI/state to the cardano-wasm JS wrapper via ports, enabling multi-wallet generation/restoration and network switching with address re-derivation.

Changes:

  • Introduce Elm module skeleton (Types/State/Update/View/Wasm/Net/Format/Ports) implementing wallet list UI, console/toast, and modal flows.
  • Expand web/ports.js port glue to generate/restore stake wallets and derive addresses for different networks.
  • Add Herald changelog fragment for the cardano-wasm demo feature set.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
cardano-wasm/demo/web/ports.js Implements Elm↔JS port handlers for wallet generation/restoration, address derivation, and clipboard writes.
cardano-wasm/demo/src/Wasm.elm Encodes outbound port commands and decodes inbound results/errors from JS.
cardano-wasm/demo/src/View.elm Adds the demo UI: wallets list/cards, restore form, console, modal, and toast.
cardano-wasm/demo/src/Update.elm Implements TEA update logic for network switching, wallet flows, logging, and copy/toast behavior.
cardano-wasm/demo/src/Types.elm Defines demo model, wallet/key types, and message/event types.
cardano-wasm/demo/src/State.elm Provides initial model and pure helpers for wallet management, logging, and toast timer.
cardano-wasm/demo/src/Ports.elm Declares the raw Elm ports used by the demo.
cardano-wasm/demo/src/Net.elm Adds static network tables/tags/magic and faucet/explorer URLs.
cardano-wasm/demo/src/Main.elm Wires Browser.element, subscriptions, and module boundaries together.
cardano-wasm/demo/src/Format.elm Adds formatting/parsing helpers (ADA/lovelace conversion, shortening, defaults).
.changes/20260718_cardano_wasm_demo_wallets.yml Declares the demo’s multi-wallet management as a feature for cardano-wasm.

Comment thread cardano-wasm/demo/web/ports.js
Comment thread cardano-wasm/demo/web/ports.js
Comment thread cardano-wasm/demo/web/ports.js
Comment thread cardano-wasm/demo/web/ports.js Outdated
Comment thread cardano-wasm/demo/src/View.elm Outdated
Comment thread cardano-wasm/demo/src/State.elm Outdated
Comment thread cardano-wasm/demo/src/Format.elm Outdated
Comment thread cardano-wasm/demo/src/Update.elm
- default to the Preview network, matching the banner's testnet-only advice
- faucet: style the link itself as a button (a button inside an anchor is
  invalid HTML) and add rel="noopener noreferrer"
- parse ADA amounts as exact decimals instead of via floats
- ignore clipboard write failures instead of leaking a rejected promise
@palas
palas marked this pull request as ready for review July 29, 2026 01:19
@palas
palas force-pushed the wasm-demo-wallet-management branch from 770c84f to 00e6e02 Compare July 29, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants