diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml
index 69ab106879..f7822fcbed 100644
--- a/.github/workflows/release_linux.yml
+++ b/.github/workflows/release_linux.yml
@@ -109,17 +109,6 @@ jobs:
run: |
cargo build --release --locked --target ${{ matrix.arch }}-unknown-linux-gnu --features trezor,ledger
- # Shared hicolor icon set for the GUI packages (deb and rpm builders
- # consume it; avoids ImageMagick in the fedora container).
- - name: Pre-generate icons
- run: |
- docker run --rm --platform linux/${{ matrix.arch }} -v "$PWD":/work -w /work debian:12 \
- bash -ec "
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -qq && apt-get install -y -qq imagemagick >/dev/null
- packaging/make-icons.sh build-tools/assets/node-gui-icon_512.png dist/assets/icons
- "
-
# GH-hosted ubuntu runners ship qemu-user-static + binfmt, so
# `docker run --platform linux/arm64` works out of the box: the arm64 leg
# runs the deb builder inside an arm64 debian:12 container. The same
@@ -136,12 +125,6 @@ jobs:
--debarch $DEBARCH \
--binaries-dir /work/target/$ARCH-unknown-linux-gnu/release \
--out /work/dist
- docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work debian:12 \
- packaging/deb/build.sh \
- --package gui --version "$VERSION" \
- --debarch $DEBARCH \
- --gui-binary /work/target/$ARCH-unknown-linux-gnu/release/node-gui \
- --repo-root /work --out /work/dist
# Arch-matched container (qemu on the arm64 leg): native strip works and
# the binaries run under emulation so help2man generates real man pages.
@@ -160,12 +143,6 @@ jobs:
--version "$VERSION" \
--binaries-dir /work/target/$ARCH-unknown-linux-gnu/release \
--out /work/dist
- docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work $FEDORA_IMAGE \
- packaging/rpm/build.sh \
- --package gui --rpmarch $ARCH \
- --version "$VERSION" \
- --gui-binary /work/target/$ARCH-unknown-linux-gnu/release/node-gui \
- --repo-root /work --out /work/dist
# Install smoke tests in fresh containers (same images as production use)
- name: Smoke test Debian packages
@@ -175,9 +152,7 @@ jobs:
ARCH=${{ matrix.arch }}
if [ "$ARCH" = "x86_64" ]; then DEBARCH=amd64; else DEBARCH=arm64; fi
docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work debian:12 \
- packaging/checks/smoke-deb.sh dist/Mintlayer_Node_linux_${VERSION}_${DEBARCH}.deb mintlayer-node node
- docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work debian:12 \
- packaging/checks/smoke-deb.sh dist/Mintlayer_Node_GUI_linux_${VERSION}_${DEBARCH}.deb mintlayer-node-gui gui
+ packaging/checks/smoke-deb.sh dist/Mintlayer_Node_linux_${VERSION}_${DEBARCH}.deb mintlayer-node
- name: Smoke test RPM packages
env:
@@ -186,9 +161,7 @@ jobs:
source packaging/images.env
ARCH=${{ matrix.arch }}
docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work $FEDORA_IMAGE \
- packaging/checks/smoke-rpm.sh dist/Mintlayer_Node_linux_${VERSION}_${ARCH}.rpm mintlayer-node node
- docker run --rm --platform linux/$ARCH -v "$PWD":/work -w /work $FEDORA_IMAGE \
- packaging/checks/smoke-rpm.sh dist/Mintlayer_Node_GUI_linux_${VERSION}_${ARCH}.rpm mintlayer-node-gui gui
+ packaging/checks/smoke-rpm.sh dist/Mintlayer_Node_linux_${VERSION}_${ARCH}.rpm mintlayer-node
# Arch images are amd64-only: the x86_64 leg is arch-matched (native
# strip, ldd-based dependencies, help2man man pages), the arm64 leg
@@ -205,12 +178,6 @@ jobs:
--version "$VERSION" \
--binaries-dir /work/target/$ARCH-unknown-linux-gnu/release \
--out /work/dist
- docker run --rm -v "$PWD":/work -w /work $ARCH_IMAGE \
- packaging/arch/build.sh \
- --package gui --arch "$ARCH" \
- --version "$VERSION" \
- --gui-binary /work/target/$ARCH-unknown-linux-gnu/release/node-gui \
- --repo-root /work --out /work/dist
# x86_64 leg: arch-matched container (native strip, ldd-based
# dependencies, help2man man pages), so the package installs natively.
@@ -226,10 +193,8 @@ jobs:
ARCH=${{ matrix.arch }}
docker run --rm -v "$PWD":/work -w /work $ARCH_IMAGE \
packaging/checks/smoke-arch.sh dist/Mintlayer_Node_linux_${VERSION}_${ARCH}.pkg.tar.zst mintlayer-node node "$ARCH"
- docker run --rm -v "$PWD":/work -w /work $ARCH_IMAGE \
- packaging/checks/smoke-arch.sh dist/Mintlayer_Node_GUI_linux_${VERSION}_${ARCH}.pkg.tar.zst mintlayer-node-gui gui "$ARCH"
- - name: Package Mintlayer Node (without GUI) as tar.gz
+ - name: Package Mintlayer Node as tar.gz
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
BINARY_LIST: ${{ inputs.binary_list }}
@@ -241,63 +206,30 @@ jobs:
done
tar -czvf Mintlayer_Node_linux_${VERSION}_${{ matrix.arch }}.tar.gz Mintlayer_Node_linux_${VERSION}_${{ matrix.arch }}
- - name: Package Mintlayer Node GUI as tar.gz
- env:
- VERSION: ${{ steps.get_version.outputs.VERSION }}
- run: |
- mkdir -p Mintlayer_Node_GUI_linux_${VERSION}_${{ matrix.arch }}
- cp target/${{ matrix.arch }}-unknown-linux-gnu/release/node-gui Mintlayer_Node_GUI_linux_${VERSION}_${{ matrix.arch }}/mintlayer-node-gui
- tar -czvf Mintlayer_Node_GUI_linux_${VERSION}_${{ matrix.arch }}.tar.gz Mintlayer_Node_GUI_linux_${VERSION}_${{ matrix.arch }}
-
- - name: Upload Node DEB Artifact (without GUI)
+ - name: Upload Node DEB Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_deb
path: dist/Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb
- - name: Upload GUI DEB Artifact
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_deb
- path: dist/Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64' }}.deb
-
- name: Upload Node RPM Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_rpm
path: dist/Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.rpm
- - name: Upload GUI RPM Artifact
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_rpm
- path: dist/Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.rpm
-
- name: Upload Node PKG Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_pkg
path: dist/Mintlayer_Node_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.pkg.tar.zst
- - name: Upload GUI PKG Artifact
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_pkg
- path: dist/Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.pkg.tar.zst
-
- name: List tar.gz files
run: |
echo "Matching tar.gz files:"
ls -l Mintlayer_Node_linux_*.tar.gz
- - name: Upload Node GUI tar.gz Artifact
- uses: actions/upload-artifact@v4
- continue-on-error: true
- with:
- name: Mintlayer_Node_GUI_linux_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}_tar.gz
- path: Mintlayer_Node_GUI_linux_*.tar.gz
-
- - name: Upload Node tar.gz Artifact (without GUI)
+ - name: Upload Node tar.gz Artifact
uses: actions/upload-artifact@v4
continue-on-error: true
with:
diff --git a/.github/workflows/release_macos.yml b/.github/workflows/release_macos.yml
index 3eb5bc86ec..2154e37665 100644
--- a/.github/workflows/release_macos.yml
+++ b/.github/workflows/release_macos.yml
@@ -46,19 +46,7 @@ jobs:
# Note: the version (and the workflow input) are passed through environment
# variables instead of direct ${{ }} interpolation into the run blocks, so
# that a crafted tag/ref/input cannot inject shell into the steps.
- - name: Sign and Notarize GUI
- env:
- MACOS_CERTIFICATE_BASE64: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
- MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
- APPLE_ID: ${{ secrets.APPLE_ID }}
- APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
- VERSION: ${{ steps.get_version.outputs.VERSION }}
- run: |
- ./build-tools/osx/sign_and_notarize.sh ${{ matrix.arch }} "$VERSION"
-
- - name: Package Mintlayer Node (without GUI)
+ - name: Package Mintlayer Node
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
BINARY_LIST: ${{ inputs.binary_list }}
@@ -70,13 +58,7 @@ jobs:
done
zip -r "Mintlayer_Node_macos_${VERSION}_${{ matrix.arch }}.zip" "Mintlayer_Node_macos_${VERSION}_${{ matrix.arch }}"
- - name: Upload DMG Artifact (GUI)
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}
- path: Mintlayer_Node_GUI_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}.dmg
-
- - name: Upload Node Artifact (without GUI)
+ - name: Upload Node Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_macos_${{ steps.get_version.outputs.VERSION }}_${{ matrix.arch }}
diff --git a/.github/workflows/release_windows.yml b/.github/workflows/release_windows.yml
index 95d2a1b237..14844f19bb 100644
--- a/.github/workflows/release_windows.yml
+++ b/.github/workflows/release_windows.yml
@@ -60,7 +60,7 @@ jobs:
with:
toolchain: stable
- - name: Build Mintlayer Node and GUI
+ - name: Build Mintlayer Node
run: cargo build --release --locked --features trezor,ledger
# Note: the version (and the workflow input) are passed through environment
@@ -73,7 +73,7 @@ jobs:
run: |
$DEST = "Mintlayer_Node_win_$env:VERSION"
New-Item -ItemType Directory -Path $DEST
- $binary_list = $env:BINARY_LIST -split ',' | Where-Object { $_ -ne "node-gui" }
+ $binary_list = $env:BINARY_LIST -split ','
foreach ($binary in $binary_list) {
$binary = $binary.Trim()
if (Test-Path "target\release\$binary.exe") {
@@ -95,28 +95,17 @@ jobs:
run: .\build-tools\win\create-license.ps1
shell: pwsh
- - name: Create NSIS installers (node + GUI)
+ - name: Create NSIS installer
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: .\build-tools\win\create-nsis-installers.ps1 -Version $env:VERSION
shell: pwsh
- - name: Smoke test installers (silent install/uninstall)
+ - name: Smoke test installer (silent install/uninstall)
env:
VERSION: ${{ steps.get_version.outputs.VERSION }}
run: |
- .\build-tools\win\smoke-install.ps1 -Installer "Mintlayer_Node_win_${env:VERSION}_Setup.exe" -AppName "Mintlayer Node" -Kind node -Version $env:VERSION
- .\build-tools\win\smoke-install.ps1 -Installer "Mintlayer_Node_GUI_win_${env:VERSION}_Setup.exe" -AppName "Mintlayer Node GUI" -Kind gui -Version $env:VERSION
- shell: pwsh
-
- - name: Package Mintlayer Node GUI
- env:
- VERSION: ${{ steps.get_version.outputs.VERSION }}
- run: |
- $DEST = "Mintlayer_Node_GUI_win_$env:VERSION"
- New-Item -ItemType Directory -Path $DEST
- Copy-Item "target\release\node-gui.exe" -Destination $DEST
- Compress-Archive -Path $DEST -DestinationPath "${DEST}.zip"
+ .\build-tools\win\smoke-install.ps1 -Installer "Mintlayer_Node_win_${env:VERSION}_Setup.exe" -AppName "Mintlayer Node" -Version $env:VERSION
shell: pwsh
- name: Upload Node ZIP Artifact
@@ -125,20 +114,8 @@ jobs:
name: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}
path: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}.zip
- - name: Upload GUI ZIP Artifact
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}
- path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}.zip
-
- name: Upload Node NSIS Installer Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}_Setup
path: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}_Setup.exe
-
- - name: Upload GUI NSIS Installer Artifact
- uses: actions/upload-artifact@v4
- with:
- name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup
- path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup.exe
diff --git a/.gitignore b/.gitignore
index f667e82237..52123cd62b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,9 +48,7 @@ target-debian/
# Rendered NSIS scripts and installers (build-tools/win/create-nsis-installers.ps1)
/installer-node.nsi
-/installer-gui.nsi
/Mintlayer_Node_win_*_Setup.exe
-/Mintlayer_Node_GUI_win_*_Setup.exe
# JS dependencies from local wasm test runs
node_modules/
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 118f978ffa..818e2f7a22 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -55,6 +55,14 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/
subscribers that fall behind are closed by the node with an error notification (at most
32 are served at a time).
+### Removed
+ - Node:
+ - the `node-gui` desktop application, its `node-gui-backend` support crate and
+ the `iced`-based GUI dependencies; desktop node management continues in the
+ Nexus wallet. The node daemon, wallet-cli, wallet-rpc-daemon and all other
+ executables are unaffected. GUI packages (deb/rpm/arch, Windows installer and
+ zip) are no longer built or released.
+
### Changed
- Consensus:
- the mainnet activation height of the consensus tightening rules (kernel
diff --git a/Cargo.lock b/Cargo.lock
index d05a445ec2..093016f22f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2,22 +2,6 @@
# It is not intended for manual editing.
version = 4
-[[package]]
-name = "ab_glyph"
-version = "0.2.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01c0457472c38ea5bd1c3b5ada5e368271cb550be7a4ca4a0b4634e9913f6cc2"
-dependencies = [
- "ab_glyph_rasterizer",
- "owned_ttf_parser",
-]
-
-[[package]]
-name = "ab_glyph_rasterizer"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
-
[[package]]
name = "accounting"
version = "1.4.5"
@@ -93,19 +77,6 @@ dependencies = [
"version_check",
]
-[[package]]
-name = "ahash"
-version = "0.8.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75"
-dependencies = [
- "cfg-if",
- "getrandom 0.3.4",
- "once_cell",
- "version_check",
- "zerocopy",
-]
-
[[package]]
name = "aho-corasick"
version = "1.1.4"
@@ -115,54 +86,12 @@ dependencies = [
"memchr",
]
-[[package]]
-name = "aliasable"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd"
-
[[package]]
name = "allocator-api2"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
-[[package]]
-name = "android-activity"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef6978589202a00cd7e118380c448a08b6ed394c3a8df3a430d0898e3a42d046"
-dependencies = [
- "android-properties",
- "bitflags 2.10.0",
- "cc",
- "cesu8",
- "jni 0.21.1",
- "jni-sys 0.3.0",
- "libc",
- "log",
- "ndk",
- "ndk-context",
- "ndk-sys 0.6.0+11769913",
- "num_enum",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "android-properties"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
-
-[[package]]
-name = "android_system_properties"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
-dependencies = [
- "libc",
-]
-
[[package]]
name = "anes"
version = "0.1.6"
@@ -398,15 +327,6 @@ dependencies = [
"utils-networking",
]
-[[package]]
-name = "approx"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
-dependencies = [
- "num-traits",
-]
-
[[package]]
name = "argon2"
version = "0.5.3"
@@ -437,42 +357,6 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
-[[package]]
-name = "as-raw-xcb-connection"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
-
-[[package]]
-name = "ash"
-version = "0.37.3+1.3.251"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a"
-dependencies = [
- "libloading 0.7.4",
-]
-
-[[package]]
-name = "ashpd"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2f3f79755c74fd155000314eb349864caa787c6592eace6c6882dad873d9c39"
-dependencies = [
- "enumflags2",
- "futures-channel",
- "futures-util",
- "rand 0.9.4",
- "raw-window-handle",
- "serde",
- "serde_repr",
- "tokio",
- "url",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "zbus 5.13.2",
-]
-
[[package]]
name = "assert_cmd"
version = "2.1.2"
@@ -488,137 +372,6 @@ dependencies = [
"wait-timeout",
]
-[[package]]
-name = "async-broadcast"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
-dependencies = [
- "event-listener",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-channel"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
-dependencies = [
- "concurrent-queue",
- "event-listener-strategy",
- "futures-core",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-executor"
-version = "1.13.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "497c00e0fd83a72a79a39fcbd8e3e2f055d6f6c7e025f3b3d91f4f8e76527fb8"
-dependencies = [
- "async-task",
- "concurrent-queue",
- "fastrand",
- "futures-lite",
- "pin-project-lite",
- "slab",
-]
-
-[[package]]
-name = "async-fs"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
-dependencies = [
- "async-lock",
- "blocking",
- "futures-lite",
-]
-
-[[package]]
-name = "async-io"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
-dependencies = [
- "autocfg",
- "cfg-if",
- "concurrent-queue",
- "futures-io",
- "futures-lite",
- "parking",
- "polling",
- "rustix 1.1.3",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-lock"
-version = "3.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
-dependencies = [
- "event-listener",
- "event-listener-strategy",
- "pin-project-lite",
-]
-
-[[package]]
-name = "async-process"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
-dependencies = [
- "async-channel",
- "async-io",
- "async-lock",
- "async-signal",
- "async-task",
- "blocking",
- "cfg-if",
- "event-listener",
- "futures-lite",
- "rustix 1.1.3",
-]
-
-[[package]]
-name = "async-recursion"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "async-signal"
-version = "0.2.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c"
-dependencies = [
- "async-io",
- "async-lock",
- "atomic-waker",
- "cfg-if",
- "futures-core",
- "futures-io",
- "rustix 1.1.3",
- "signal-hook-registry",
- "slab",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "async-task"
-version = "4.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
-
[[package]]
name = "async-trait"
version = "0.1.89"
@@ -782,7 +535,7 @@ checksum = "d89aabfae550a5c44b43ab941844ffcd2e993cb6900b342debf59e9ea74acdb8"
dependencies = [
"async-trait",
"futures-util",
- "parking_lot 0.12.5",
+ "parking_lot",
"tokio",
]
@@ -835,30 +588,15 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "bit-set"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
-dependencies = [
- "bit-vec 0.6.3",
-]
-
[[package]]
name = "bit-set"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
dependencies = [
- "bit-vec 0.8.0",
+ "bit-vec",
]
-[[package]]
-name = "bit-vec"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
-
[[package]]
name = "bit-vec"
version = "0.8.0"
@@ -958,12 +696,6 @@ dependencies = [
"digest 0.10.7",
]
-[[package]]
-name = "block"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
-
[[package]]
name = "block-buffer"
version = "0.10.4"
@@ -988,29 +720,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f"
dependencies = [
- "objc2 0.5.2",
-]
-
-[[package]]
-name = "block2"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
-dependencies = [
- "objc2 0.6.3",
-]
-
-[[package]]
-name = "blocking"
-version = "1.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
-dependencies = [
- "async-channel",
- "async-task",
- "futures-io",
- "futures-lite",
- "piper",
+ "objc2",
]
[[package]]
@@ -1091,7 +801,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d1da5ab77c1437701eeff7c88d968729e7766172279eab0676857b3d63af7a6f"
dependencies = [
"borsh-derive",
- "cfg_aliases 0.2.1",
+ "cfg_aliases",
]
[[package]]
@@ -1142,16 +852,16 @@ dependencies = [
"jni 0.19.0",
"jni-utils",
"log",
- "objc2 0.5.2",
+ "objc2",
"objc2-core-bluetooth",
- "objc2-foundation 0.2.2",
+ "objc2-foundation",
"once_cell",
"static_assertions",
"thiserror 2.0.18",
"tokio",
"tokio-stream",
"uuid",
- "windows 0.61.3",
+ "windows",
"windows-future",
]
@@ -1168,12 +878,6 @@ version = "3.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
-[[package]]
-name = "by_address"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06"
-
[[package]]
name = "byte-slice-cast"
version = "1.2.3"
@@ -1214,26 +918,6 @@ dependencies = [
"syn 1.0.109",
]
-[[package]]
-name = "bytemuck"
-version = "1.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
-dependencies = [
- "bytemuck_derive",
-]
-
-[[package]]
-name = "bytemuck_derive"
-version = "1.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
[[package]]
name = "byteorder"
version = "1.5.0"
@@ -1246,57 +930,6 @@ version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
-[[package]]
-name = "calloop"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b99da2f8558ca23c71f4fd15dc57c906239752dd27ff3c00a1d56b685b7cbfec"
-dependencies = [
- "bitflags 2.10.0",
- "log",
- "polling",
- "rustix 0.38.44",
- "slab",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "calloop"
-version = "0.14.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb9f6e1368bd4621d2c86baa7e37de77a938adf5221e5dd3d6133340101b309e"
-dependencies = [
- "bitflags 2.10.0",
- "polling",
- "rustix 1.1.3",
- "slab",
- "tracing",
-]
-
-[[package]]
-name = "calloop-wayland-source"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20"
-dependencies = [
- "calloop 0.13.0",
- "rustix 0.38.44",
- "wayland-backend",
- "wayland-client",
-]
-
-[[package]]
-name = "calloop-wayland-source"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "138efcf0940a02ebf0cc8d1eff41a1682a46b431630f4c52450d6265876021fa"
-dependencies = [
- "calloop 0.14.3",
- "rustix 1.1.3",
- "wayland-backend",
- "wayland-client",
-]
-
[[package]]
name = "cast"
version = "0.3.0"
@@ -1310,8 +943,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
dependencies = [
"find-msvc-tools",
- "jobserver",
- "libc",
"shlex",
]
@@ -1327,12 +958,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
-[[package]]
-name = "cfg_aliases"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
-
[[package]]
name = "cfg_aliases"
version = "0.2.1"
@@ -1652,7 +1277,7 @@ version = "4.5.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5"
dependencies = [
- "heck 0.5.0",
+ "heck",
"proc-macro2",
"quote",
"syn 2.0.114",
@@ -1665,96 +1290,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
[[package]]
-name = "clipboard-win"
-version = "5.4.1"
+name = "cmov"
+version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bde03770d3df201d4fb868f2c9c59e66a3e4e2bd06692a0fe701e7103c7e84d4"
-dependencies = [
- "error-code",
-]
+checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
[[package]]
-name = "clipboard_macos"
-version = "0.1.1"
+name = "colorchoice"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b7f4aaa047ba3c3630b080bb9860894732ff23e2aee290a418909aa6d5df38f"
-dependencies = [
- "objc2 0.5.2",
- "objc2-app-kit 0.2.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "clipboard_wayland"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "003f886bc4e2987729d10c1db3424e7f80809f3fc22dbc16c685738887cb37b8"
-dependencies = [
- "smithay-clipboard",
-]
-
-[[package]]
-name = "clipboard_x11"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd63e33452ffdafd39924c4f05a5dd1e94db646c779c6bd59148a3d95fff5ad4"
-dependencies = [
- "thiserror 2.0.18",
- "x11rb",
-]
-
-[[package]]
-name = "cmov"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
-
-[[package]]
-name = "codespan-reporting"
-version = "0.11.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
-dependencies = [
- "termcolor",
- "unicode-width 0.1.14",
-]
-
-[[package]]
-name = "colorchoice"
-version = "1.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
-
-[[package]]
-name = "com"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6"
-dependencies = [
- "com_macros",
-]
-
-[[package]]
-name = "com_macros"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5"
-dependencies = [
- "com_macros_support",
- "proc-macro2",
- "syn 1.0.109",
-]
-
-[[package]]
-name = "com_macros_support"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 1.0.109",
-]
+checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75"
[[package]]
name = "combine"
@@ -1817,15 +1362,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "concurrent-queue"
-version = "2.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
-dependencies = [
- "crossbeam-utils",
-]
-
[[package]]
name = "consensus"
version = "1.4.5"
@@ -1988,53 +1524,6 @@ version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-[[package]]
-name = "core-graphics"
-version = "0.23.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation 0.9.4",
- "core-graphics-types",
- "foreign-types 0.5.0",
- "libc",
-]
-
-[[package]]
-name = "core-graphics-types"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
-dependencies = [
- "bitflags 1.3.2",
- "core-foundation 0.9.4",
- "libc",
-]
-
-[[package]]
-name = "cosmic-text"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59fd57d82eb4bfe7ffa9b1cec0c05e2fd378155b47f255a67983cb4afe0e80c2"
-dependencies = [
- "bitflags 2.10.0",
- "fontdb",
- "log",
- "rangemap",
- "rayon",
- "rustc-hash 1.1.0",
- "rustybuzz",
- "self_cell",
- "swash",
- "sys-locale",
- "ttf-parser 0.21.1",
- "unicode-bidi",
- "unicode-linebreak",
- "unicode-script",
- "unicode-segmentation",
-]
-
[[package]]
name = "cpufeatures"
version = "0.2.17"
@@ -2169,7 +1658,7 @@ dependencies = [
"bitflags 2.10.0",
"crossterm_winapi",
"mio",
- "parking_lot 0.12.5",
+ "parking_lot",
"rustix 0.38.44",
"serde",
"signal-hook",
@@ -2281,12 +1770,6 @@ dependencies = [
"link-section",
]
-[[package]]
-name = "ctor-lite"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b29fccfdaeb0f9bd90da5759b1d0eaa2f6cfcfe90960124cfc83141ed4e111fd"
-
[[package]]
name = "ctor-proc-macro"
version = "0.0.13"
@@ -2311,12 +1794,6 @@ dependencies = [
"cmov",
]
-[[package]]
-name = "cursor-icon"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
-
[[package]]
name = "curve25519-dalek"
version = "4.1.3"
@@ -2344,33 +1821,6 @@ dependencies = [
"syn 2.0.114",
]
-[[package]]
-name = "d3d12"
-version = "0.19.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307"
-dependencies = [
- "bitflags 2.10.0",
- "libloading 0.8.9",
- "winapi",
-]
-
-[[package]]
-name = "dark-light"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a76fa97167fa740dcdbfe18e8895601e1bc36525f09b044e00916e717c03a3c"
-dependencies = [
- "dconf_rs",
- "detect-desktop-environment",
- "dirs",
- "objc",
- "rust-ini",
- "web-sys",
- "winreg",
- "zbus 4.4.0",
-]
-
[[package]]
name = "darling"
version = "0.14.4"
@@ -2450,7 +1900,7 @@ dependencies = [
"hashbrown 0.14.5",
"lock_api",
"once_cell",
- "parking_lot_core 0.9.12",
+ "parking_lot_core",
]
[[package]]
@@ -2464,7 +1914,7 @@ dependencies = [
"hashbrown 0.14.5",
"lock_api",
"once_cell",
- "parking_lot_core 0.9.12",
+ "parking_lot_core",
]
[[package]]
@@ -2497,12 +1947,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "dconf_rs"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7046468a81e6a002061c01e6a7c83139daf91b11c30e66795b13217c2d885c8b"
-
[[package]]
name = "deranged"
version = "0.5.5"
@@ -2558,12 +2002,6 @@ dependencies = [
"unicode-xid",
]
-[[package]]
-name = "detect-desktop-environment"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21d8ad60dd5b13a4ee6bd8fa2d5d88965c597c67bce32b5fc49c94f55cb50810"
-
[[package]]
name = "dialoguer"
version = "0.11.0"
@@ -2612,16 +2050,7 @@ version = "5.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35"
dependencies = [
- "dirs-sys 0.4.1",
-]
-
-[[package]]
-name = "dirs"
-version = "4.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
-dependencies = [
- "dirs-sys 0.3.7",
+ "dirs-sys",
]
[[package]]
@@ -2634,17 +2063,6 @@ dependencies = [
"dirs-sys-next",
]
-[[package]]
-name = "dirs-sys"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
[[package]]
name = "dirs-sys"
version = "0.4.1"
@@ -2668,24 +2086,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "dispatch"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b"
-
-[[package]]
-name = "dispatch2"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.6.2",
- "libc",
- "objc2 0.6.3",
-]
-
[[package]]
name = "displaydoc"
version = "0.2.5"
@@ -2703,21 +2103,6 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"
-[[package]]
-name = "dlib"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412"
-dependencies = [
- "libloading 0.8.9",
-]
-
-[[package]]
-name = "dlv-list"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257"
-
[[package]]
name = "dns-server"
version = "1.4.5"
@@ -2759,58 +2144,6 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1"
-[[package]]
-name = "downcast-rs"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
-
-[[package]]
-name = "dpi"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
-
-[[package]]
-name = "drm"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f"
-dependencies = [
- "bitflags 2.10.0",
- "bytemuck",
- "drm-ffi",
- "drm-fourcc",
- "libc",
- "rustix 0.38.44",
-]
-
-[[package]]
-name = "drm-ffi"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8e41459d99a9b529845f6d2c909eb9adf3b6d2f82635ae40be8de0601726e8b"
-dependencies = [
- "drm-sys",
- "rustix 0.38.44",
-]
-
-[[package]]
-name = "drm-fourcc"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4"
-
-[[package]]
-name = "drm-sys"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bafb66c8dbc944d69e15cfcc661df7e703beffbaec8bd63151368b06c5f9858c"
-dependencies = [
- "libc",
- "linux-raw-sys 0.6.5",
-]
-
[[package]]
name = "dtor"
version = "0.8.1"
@@ -2888,12 +2221,6 @@ dependencies = [
"cfg-if",
]
-[[package]]
-name = "endi"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
-
[[package]]
name = "enum-iterator"
version = "2.3.0"
@@ -2921,7 +2248,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
- "serde",
]
[[package]]
@@ -2951,58 +2277,12 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "error-code"
-version = "3.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"
-
[[package]]
name = "escape8259"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6"
-[[package]]
-name = "etagere"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc89bf99e5dc15954a60f707c1e09d7540e5cd9af85fa75caa0b510bc08c5342"
-dependencies = [
- "euclid",
- "svg_fmt",
-]
-
-[[package]]
-name = "euclid"
-version = "0.22.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df61bf483e837f88d5c2291dcf55c67be7e676b3a51acc48db3a7b163b91ed63"
-dependencies = [
- "num-traits",
-]
-
-[[package]]
-name = "event-listener"
-version = "5.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"
-dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener-strategy"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
-dependencies = [
- "event-listener",
- "pin-project-lite",
-]
-
[[package]]
name = "expect-test"
version = "1.5.1"
@@ -3031,12 +2311,6 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
-[[package]]
-name = "fast-srgb8"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd2e7510819d6fbf51a5545c8f922716ecfb14df168a3242f7d33e0239efe6a1"
-
[[package]]
name = "fastrand"
version = "2.3.0"
@@ -3054,15 +2328,6 @@ dependencies = [
"windows-sys 0.52.0",
]
-[[package]]
-name = "fdeflate"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c"
-dependencies = [
- "simd-adler32",
-]
-
[[package]]
name = "fiat-crypto"
version = "0.2.9"
@@ -3124,12 +2389,6 @@ dependencies = [
"miniz_oxide",
]
-[[package]]
-name = "float_next_after"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bf7cc16383c4b8d58b9905a8509f02926ce3058053c056376248d958c9df1e8"
-
[[package]]
name = "fnv"
version = "1.0.7"
@@ -3149,85 +2408,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
-name = "font-types"
-version = "0.7.3"
+name = "foreign-types"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3971f9a5ca983419cdc386941ba3b9e1feba01a0ab888adf78739feb2798492"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
- "bytemuck",
+ "foreign-types-shared",
]
[[package]]
-name = "fontconfig-parser"
-version = "0.5.7"
-source = "git+https://github.com/Riey/fontconfig-parser?rev=f7d13a779e6ee282ce75acbc00a1270c0350e0c2#f7d13a779e6ee282ce75acbc00a1270c0350e0c2"
-dependencies = [
- "roxmltree",
-]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
-name = "fontdb"
-version = "0.16.2"
+name = "form_urlencoded"
+version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b0299020c3ef3f60f526a4f64ab4a3d4ce116b1acbf24cdd22da0068e5d81dc3"
+checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
dependencies = [
- "fontconfig-parser",
- "log",
- "memmap2",
- "slotmap",
- "tinyvec",
- "ttf-parser 0.20.0",
-]
-
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared 0.1.1",
-]
-
-[[package]]
-name = "foreign-types"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
-dependencies = [
- "foreign-types-macros",
- "foreign-types-shared 0.3.1",
-]
-
-[[package]]
-name = "foreign-types-macros"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
-
-[[package]]
-name = "form_urlencoded"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afa489199eaffb1211795df1c6236ce1ad0d41a6fa45250add73e3b02420f06e"
-dependencies = [
- "percent-encoding",
+ "percent-encoding",
]
[[package]]
@@ -3302,7 +2503,6 @@ dependencies = [
"futures-core",
"futures-task",
"futures-util",
- "num_cpus",
]
[[package]]
@@ -3311,19 +2511,6 @@ version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
-[[package]]
-name = "futures-lite"
-version = "2.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
-dependencies = [
- "fastrand",
- "futures-core",
- "futures-io",
- "parking",
- "pin-project-lite",
-]
-
[[package]]
name = "futures-macro"
version = "0.3.31"
@@ -3396,16 +2583,6 @@ dependencies = [
"version_check",
]
-[[package]]
-name = "gethostname"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bd49230192a3797a9a4d6abe9b3eed6f7fa4c8a8a4947977c6f80025f92cbd8"
-dependencies = [
- "rustix 1.1.3",
- "windows-link 0.2.1",
-]
-
[[package]]
name = "getrandom"
version = "0.2.17"
@@ -3467,23 +2644,6 @@ dependencies = [
"polyval",
]
-[[package]]
-name = "gl_generator"
-version = "0.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
-dependencies = [
- "khronos_api",
- "log",
- "xml-rs",
-]
-
-[[package]]
-name = "glam"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "151665d9be52f9bb40fc7966565d39666f2d1e69233571b71b87791c7e0528b3"
-
[[package]]
name = "glob"
version = "0.3.3"
@@ -3503,89 +2663,6 @@ dependencies = [
"web-sys",
]
-[[package]]
-name = "glow"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1"
-dependencies = [
- "js-sys",
- "slotmap",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "glutin_wgl_sys"
-version = "0.5.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead"
-dependencies = [
- "gl_generator",
-]
-
-[[package]]
-name = "gpu-alloc"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
-dependencies = [
- "bitflags 2.10.0",
- "gpu-alloc-types",
-]
-
-[[package]]
-name = "gpu-alloc-types"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
-dependencies = [
- "bitflags 2.10.0",
-]
-
-[[package]]
-name = "gpu-allocator"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884"
-dependencies = [
- "log",
- "presser",
- "thiserror 1.0.69",
- "winapi",
- "windows 0.52.0",
-]
-
-[[package]]
-name = "gpu-descriptor"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c"
-dependencies = [
- "bitflags 2.10.0",
- "gpu-descriptor-types",
- "hashbrown 0.14.5",
-]
-
-[[package]]
-name = "gpu-descriptor-types"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c"
-dependencies = [
- "bitflags 2.10.0",
-]
-
-[[package]]
-name = "guillotiere"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782"
-dependencies = [
- "euclid",
- "svg_fmt",
-]
-
[[package]]
name = "h2"
version = "0.4.18"
@@ -3631,7 +2708,7 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
- "ahash 0.7.8",
+ "ahash",
]
[[package]]
@@ -3639,10 +2716,6 @@ name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
-dependencies = [
- "ahash 0.8.12",
- "allocator-api2",
-]
[[package]]
name = "hashbrown"
@@ -3658,11 +2731,6 @@ name = "hashbrown"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
-dependencies = [
- "allocator-api2",
- "equivalent",
- "foldhash 0.2.0",
-]
[[package]]
name = "hashbrown"
@@ -3684,21 +2752,6 @@ dependencies = [
"hashbrown 0.15.5",
]
-[[package]]
-name = "hassle-rs"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890"
-dependencies = [
- "bitflags 2.10.0",
- "com",
- "libc",
- "libloading 0.8.9",
- "thiserror 1.0.69",
- "widestring",
- "winapi",
-]
-
[[package]]
name = "hdrhistogram"
version = "7.5.4"
@@ -3722,12 +2775,6 @@ dependencies = [
"stable_deref_trait",
]
-[[package]]
-name = "heck"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
-
[[package]]
name = "heck"
version = "0.5.0"
@@ -3767,12 +2814,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd"
-[[package]]
-name = "hexf-parse"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
-
[[package]]
name = "hickory-net"
version = "0.26.3"
@@ -4026,301 +3067,97 @@ dependencies = [
]
[[package]]
-name = "iced"
-version = "0.13.1"
+name = "icu_collections"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88acfabc84ec077eaf9ede3457ffa3a104626d79022a9bf7f296093b1d60c73f"
+checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
dependencies = [
- "iced_core",
- "iced_futures",
- "iced_renderer",
- "iced_widget",
- "iced_winit",
- "thiserror 1.0.69",
+ "displaydoc",
+ "potential_utf",
+ "yoke",
+ "zerofrom",
+ "zerovec",
]
[[package]]
-name = "iced_aw"
-version = "0.12.2"
-source = "git+https://github.com/iced-rs/iced_aw?rev=def1db9aac1e58a47e0c3127d4d4e95d724ca8ad#def1db9aac1e58a47e0c3127d4d4e95d724ca8ad"
+name = "icu_locale_core"
+version = "2.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
dependencies = [
- "cfg-if",
- "iced",
- "iced_fonts",
- "itertools 0.14.0",
- "num-format",
- "num-traits",
- "web-time",
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
]
[[package]]
-name = "iced_core"
-version = "0.13.2"
+name = "icu_normalizer"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0013a238275494641bf8f1732a23a808196540dc67b22ff97099c044ae4c8a1c"
+checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
dependencies = [
- "bitflags 2.10.0",
- "bytes",
- "dark-light",
- "glam",
- "log",
- "num-traits",
- "once_cell",
- "palette",
- "rustc-hash 2.1.1",
- "smol_str",
- "thiserror 1.0.69",
- "web-time",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "zerovec",
]
[[package]]
-name = "iced_fonts"
-version = "0.1.1"
+name = "icu_normalizer_data"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df7deb0800a850ee25c8a42559f72c0f249e577feb3aad37b9b65dc1e517e52a"
-dependencies = [
- "iced_core",
-]
+checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
[[package]]
-name = "iced_futures"
-version = "0.13.2"
+name = "icu_properties"
+version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c04a6745ba2e80f32cf01e034fd00d853aa4f4cd8b91888099cb7aaee0d5d7c"
+checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
dependencies = [
- "futures",
- "iced_core",
- "log",
- "rustc-hash 2.1.1",
- "tokio",
- "wasm-bindgen-futures",
- "wasm-timer",
+ "icu_collections",
+ "icu_locale_core",
+ "icu_properties_data",
+ "icu_provider",
+ "zerotrie",
+ "zerovec",
]
[[package]]
-name = "iced_glyphon"
-version = "0.6.0"
-source = "git+https://github.com/mintlayer/iced-glyphon?rev=acb3fc10a3a15ee6e0e7da4e264db2338c09a7c1#acb3fc10a3a15ee6e0e7da4e264db2338c09a7c1"
-dependencies = [
- "cosmic-text",
- "etagere",
- "lru",
- "rustc-hash 2.1.1",
- "wgpu",
-]
+name = "icu_properties_data"
+version = "2.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
[[package]]
-name = "iced_graphics"
-version = "0.13.0"
+name = "icu_provider"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba25a18cfa6d5cc160aca7e1b34f73ccdff21680fa8702168c09739767b6c66f"
+checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
dependencies = [
- "bitflags 2.10.0",
- "bytemuck",
- "cosmic-text",
- "half",
- "iced_core",
- "iced_futures",
- "log",
- "lyon_path",
- "once_cell",
- "raw-window-handle",
- "rustc-hash 2.1.1",
- "thiserror 1.0.69",
- "unicode-segmentation",
+ "displaydoc",
+ "icu_locale_core",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerotrie",
+ "zerovec",
]
[[package]]
-name = "iced_renderer"
-version = "0.13.0"
+name = "id-arena"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73558208059f9e622df2bf434e044ee2f838ce75201a023cf0ca3e1244f46c2a"
-dependencies = [
- "iced_graphics",
- "iced_tiny_skia",
- "iced_wgpu",
- "log",
- "thiserror 1.0.69",
-]
+checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
-name = "iced_runtime"
-version = "0.13.2"
+name = "ident_case"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "348b5b2c61c934d88ca3b0ed1ed913291e923d086a66fa288ce9669da9ef62b5"
-dependencies = [
- "bytes",
- "iced_core",
- "iced_futures",
- "raw-window-handle",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "iced_tiny_skia"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c625d368284fcc43b0b36b176f76eff1abebe7959dd58bd8ce6897d641962a50"
-dependencies = [
- "bytemuck",
- "cosmic-text",
- "iced_graphics",
- "kurbo",
- "log",
- "rustc-hash 2.1.1",
- "softbuffer",
- "tiny-skia",
-]
-
-[[package]]
-name = "iced_wgpu"
-version = "0.13.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15708887133671d2bcc6c1d01d1f176f43a64d6cdc3b2bf893396c3ee498295f"
-dependencies = [
- "bitflags 2.10.0",
- "bytemuck",
- "futures",
- "glam",
- "guillotiere",
- "iced_glyphon",
- "iced_graphics",
- "log",
- "lyon",
- "once_cell",
- "rustc-hash 2.1.1",
- "thiserror 1.0.69",
- "wgpu",
-]
-
-[[package]]
-name = "iced_widget"
-version = "0.13.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81429e1b950b0e4bca65be4c4278fea6678ea782030a411778f26fa9f8983e1d"
-dependencies = [
- "iced_renderer",
- "iced_runtime",
- "num-traits",
- "once_cell",
- "ouroboros",
- "rustc-hash 2.1.1",
- "thiserror 1.0.69",
- "unicode-segmentation",
-]
-
-[[package]]
-name = "iced_winit"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f44cd4e1c594b6334f409282937bf972ba14d31fedf03c23aa595d982a2fda28"
-dependencies = [
- "iced_futures",
- "iced_graphics",
- "iced_runtime",
- "log",
- "rustc-hash 2.1.1",
- "thiserror 1.0.69",
- "tracing",
- "wasm-bindgen-futures",
- "web-sys",
- "winapi",
- "window_clipboard",
- "winit",
-]
-
-[[package]]
-name = "icu_collections"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
-dependencies = [
- "displaydoc",
- "potential_utf",
- "yoke",
- "zerofrom",
- "zerovec",
-]
-
-[[package]]
-name = "icu_locale_core"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
-dependencies = [
- "displaydoc",
- "litemap",
- "tinystr",
- "writeable",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
-dependencies = [
- "icu_collections",
- "icu_normalizer_data",
- "icu_properties",
- "icu_provider",
- "smallvec",
- "zerovec",
-]
-
-[[package]]
-name = "icu_normalizer_data"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
-
-[[package]]
-name = "icu_properties"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec"
-dependencies = [
- "icu_collections",
- "icu_locale_core",
- "icu_properties_data",
- "icu_provider",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "icu_properties_data"
-version = "2.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af"
-
-[[package]]
-name = "icu_provider"
-version = "2.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
-dependencies = [
- "displaydoc",
- "icu_locale_core",
- "writeable",
- "yoke",
- "zerofrom",
- "zerotrie",
- "zerovec",
-]
-
-[[package]]
-name = "id-arena"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
+checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
@@ -4395,15 +3232,6 @@ dependencies = [
"generic-array",
]
-[[package]]
-name = "instant"
-version = "0.1.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
-dependencies = [
- "cfg-if",
-]
-
[[package]]
name = "ipnet"
version = "2.11.0"
@@ -4640,16 +3468,6 @@ dependencies = [
"uuid",
]
-[[package]]
-name = "jobserver"
-version = "0.1.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
-dependencies = [
- "getrandom 0.3.4",
- "libc",
-]
-
[[package]]
name = "js-sys"
version = "0.3.85"
@@ -4713,10 +3531,10 @@ dependencies = [
"http-body",
"http-body-util",
"jsonrpsee-types",
- "parking_lot 0.12.5",
+ "parking_lot",
"pin-project",
"rand 0.9.4",
- "rustc-hash 2.1.1",
+ "rustc-hash",
"serde",
"serde_json",
"thiserror 2.0.18",
@@ -4755,7 +3573,7 @@ version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2da3f8ab5ce1bb124b6d082e62dffe997578ceaf0aeb9f3174a214589dc00f07"
dependencies = [
- "heck 0.5.0",
+ "heck",
"proc-macro-crate",
"proc-macro2",
"quote",
@@ -4824,33 +3642,6 @@ dependencies = [
"cpufeatures 0.2.17",
]
-[[package]]
-name = "khronos-egl"
-version = "6.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"
-dependencies = [
- "libc",
- "libloading 0.8.9",
- "pkg-config",
-]
-
-[[package]]
-name = "khronos_api"
-version = "3.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
-
-[[package]]
-name = "kurbo"
-version = "0.10.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1618d4ebd923e97d67e7cd363d80aef35fe961005cbbbb3d2dad8bdd1bc63440"
-dependencies = [
- "arrayvec",
- "smallvec",
-]
-
[[package]]
name = "lazy_static"
version = "1.5.0"
@@ -4912,26 +3703,6 @@ dependencies = [
"pkg-config",
]
-[[package]]
-name = "libloading"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
-dependencies = [
- "cfg-if",
- "winapi",
-]
-
-[[package]]
-name = "libloading"
-version = "0.8.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
-dependencies = [
- "cfg-if",
- "windows-link 0.2.1",
-]
-
[[package]]
name = "libm"
version = "0.2.16"
@@ -4946,7 +3717,6 @@ checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
dependencies = [
"bitflags 2.10.0",
"libc",
- "redox_syscall 0.7.0",
]
[[package]]
@@ -4996,12 +3766,6 @@ version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
-[[package]]
-name = "linux-raw-sys"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7"
-
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
@@ -5092,76 +3856,6 @@ dependencies = [
"tracing-subscriber",
]
-[[package]]
-name = "lru"
-version = "0.16.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39"
-dependencies = [
- "hashbrown 0.16.1",
-]
-
-[[package]]
-name = "lyon"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dbcb7d54d54c8937364c9d41902d066656817dce1e03a44e5533afebd1ef4352"
-dependencies = [
- "lyon_algorithms",
- "lyon_tessellation",
-]
-
-[[package]]
-name = "lyon_algorithms"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c0829e28c4f336396f250d850c3987e16ce6db057ffe047ce0dd54aab6b647"
-dependencies = [
- "lyon_path",
- "num-traits",
-]
-
-[[package]]
-name = "lyon_geom"
-version = "1.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e260b6de923e6e47adfedf6243013a7a874684165a6a277594ee3906021b2343"
-dependencies = [
- "arrayvec",
- "euclid",
- "num-traits",
-]
-
-[[package]]
-name = "lyon_path"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1aeca86bcfd632a15984ba029b539ffb811e0a70bf55e814ef8b0f54f506fdeb"
-dependencies = [
- "lyon_geom",
- "num-traits",
-]
-
-[[package]]
-name = "lyon_tessellation"
-version = "1.0.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3f586142e1280335b1bc89539f7c97dd80f08fc43e9ab1b74ef0a42b04aa353"
-dependencies = [
- "float_next_after",
- "lyon_path",
- "num-traits",
-]
-
-[[package]]
-name = "malloc_buf"
-version = "0.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
-dependencies = [
- "libc",
-]
-
[[package]]
name = "matchers"
version = "0.2.0"
@@ -5199,24 +3893,6 @@ version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"
-[[package]]
-name = "memmap2"
-version = "0.9.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "744133e4a0e0a658e1374cf3bf8e415c4052a15a111acd372764c55b4177d490"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "memoffset"
-version = "0.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
-dependencies = [
- "autocfg",
-]
-
[[package]]
name = "mempool"
version = "1.4.5"
@@ -5243,7 +3919,7 @@ dependencies = [
"num-traits",
"orders-accounting",
"p2p-types",
- "parking_lot 0.12.5",
+ "parking_lot",
"pos-accounting",
"randomness",
"rpc",
@@ -5297,21 +3973,6 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "metal"
-version = "0.27.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25"
-dependencies = [
- "bitflags 2.10.0",
- "block",
- "core-graphics-types",
- "foreign-types 0.5.0",
- "log",
- "objc",
- "paste",
-]
-
[[package]]
name = "mime"
version = "0.3.17"
@@ -5485,26 +4146,6 @@ dependencies = [
"utxo",
]
-[[package]]
-name = "naga"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843"
-dependencies = [
- "bit-set 0.5.3",
- "bitflags 2.10.0",
- "codespan-reporting",
- "hexf-parse",
- "indexmap 2.13.0",
- "log",
- "num-traits",
- "rustc-hash 1.1.0",
- "spirv",
- "termcolor",
- "thiserror 1.0.69",
- "unicode-xid",
-]
-
[[package]]
name = "native-tls"
version = "0.2.14"
@@ -5522,45 +4163,6 @@ dependencies = [
"tempfile",
]
-[[package]]
-name = "ndk"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3f42e7bbe13d351b6bead8286a43aac9534b82bd3cc43e47037f012ebfd62d4"
-dependencies = [
- "bitflags 2.10.0",
- "jni-sys 0.3.0",
- "log",
- "ndk-sys 0.6.0+11769913",
- "num_enum",
- "raw-window-handle",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "ndk-context"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b"
-
-[[package]]
-name = "ndk-sys"
-version = "0.5.0+25.2.9519653"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
-dependencies = [
- "jni-sys 0.3.0",
-]
-
-[[package]]
-name = "ndk-sys"
-version = "0.6.0+11769913"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee6cda3051665f1fb8d9e08fc35c96d5a244fb1be711a03b71118828afc9a873"
-dependencies = [
- "jni-sys 0.3.0",
-]
-
[[package]]
name = "networking"
version = "1.4.5"
@@ -5586,19 +4188,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "nix"
-version = "0.29.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
-dependencies = [
- "bitflags 2.10.0",
- "cfg-if",
- "cfg_aliases 0.2.1",
- "libc",
- "memoffset",
-]
-
[[package]]
name = "node-comm"
version = "1.4.5"
@@ -5650,75 +4239,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "node-gui"
-version = "1.4.5"
-dependencies = [
- "anyhow",
- "chainstate",
- "common",
- "ctor",
- "futures",
- "heck 0.5.0",
- "iced",
- "iced_aw",
- "iced_fonts",
- "jiff",
- "logging",
- "networking",
- "node-comm",
- "node-gui-backend",
- "node-lib",
- "p2p",
- "rfd",
- "serialization",
- "storage",
- "strum 0.26.3",
- "thiserror 1.0.69",
- "tokio",
- "utils",
- "wallet",
- "wallet-cli-commands",
- "wallet-controller",
- "wallet-storage",
- "wallet-types",
- "winres",
-]
-
-[[package]]
-name = "node-gui-backend"
-version = "1.4.5"
-dependencies = [
- "anyhow",
- "chainstate",
- "common",
- "crypto",
- "futures",
- "itertools 0.14.0",
- "logging",
- "mempool",
- "node-comm",
- "node-lib",
- "p2p",
- "rstest",
- "semver",
- "serde",
- "serde_json",
- "serde_with",
- "serialization",
- "subsystem",
- "test-utils",
- "thiserror 1.0.69",
- "tokio",
- "utils",
- "wallet",
- "wallet-cli-commands",
- "wallet-controller",
- "wallet-rpc-client",
- "wallet-rpc-lib",
- "wallet-types",
-]
-
[[package]]
name = "node-lib"
version = "1.4.5"
@@ -5753,7 +4273,7 @@ dependencies = [
"test-rpc-functions",
"thiserror 1.0.69",
"tokio",
- "toml 0.8.23",
+ "toml",
"utils",
"utils-networking",
"zeroize",
@@ -5828,16 +4348,6 @@ dependencies = [
"syn 2.0.114",
]
-[[package]]
-name = "num-format"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3"
-dependencies = [
- "arrayvec",
- "itoa",
-]
-
[[package]]
name = "num-integer"
version = "0.1.46"
@@ -5876,17 +4386,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
dependencies = [
"autocfg",
- "libm",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b"
-dependencies = [
- "hermit-abi",
- "libc",
]
[[package]]
@@ -5905,22 +4404,11 @@ version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7"
dependencies = [
- "proc-macro-crate",
"proc-macro2",
"quote",
"syn 2.0.114",
]
-[[package]]
-name = "objc"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
-dependencies = [
- "malloc_buf",
- "objc_exception",
-]
-
[[package]]
name = "objc-sys"
version = "0.3.5"
@@ -5937,67 +4425,6 @@ dependencies = [
"objc2-encode",
]
-[[package]]
-name = "objc2"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05"
-dependencies = [
- "objc2-encode",
-]
-
-[[package]]
-name = "objc2-app-kit"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "libc",
- "objc2 0.5.2",
- "objc2-core-data",
- "objc2-core-image",
- "objc2-foundation 0.2.2",
- "objc2-quartz-core 0.2.2",
-]
-
-[[package]]
-name = "objc2-app-kit"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.6.2",
- "objc2 0.6.3",
- "objc2-foundation 0.3.2",
-]
-
-[[package]]
-name = "objc2-cloud-kit"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-core-location",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-contacts"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889"
-dependencies = [
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
[[package]]
name = "objc2-core-bluetooth"
version = "0.2.2"
@@ -6005,68 +4432,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a644b62ffb826a5277f536cf0f701493de420b13d40e700c452c36567771111"
dependencies = [
"bitflags 2.10.0",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-core-data"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-core-foundation"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
-dependencies = [
- "bitflags 2.10.0",
- "dispatch2",
- "objc2 0.6.3",
-]
-
-[[package]]
-name = "objc2-core-graphics"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
-dependencies = [
- "bitflags 2.10.0",
- "dispatch2",
- "objc2 0.6.3",
- "objc2-core-foundation",
- "objc2-io-surface",
-]
-
-[[package]]
-name = "objc2-core-image"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80"
-dependencies = [
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
- "objc2-metal",
-]
-
-[[package]]
-name = "objc2-core-location"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781"
-dependencies = [
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-contacts",
- "objc2-foundation 0.2.2",
+ "objc2",
+ "objc2-foundation",
]
[[package]]
@@ -6082,145 +4449,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8"
dependencies = [
"bitflags 2.10.0",
- "block2 0.5.1",
- "dispatch",
+ "block2",
"libc",
- "objc2 0.5.2",
-]
-
-[[package]]
-name = "objc2-foundation"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
-dependencies = [
- "bitflags 2.10.0",
- "objc2 0.6.3",
- "objc2-core-foundation",
-]
-
-[[package]]
-name = "objc2-io-surface"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
-dependencies = [
- "bitflags 2.10.0",
- "objc2 0.6.3",
- "objc2-core-foundation",
-]
-
-[[package]]
-name = "objc2-link-presentation"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398"
-dependencies = [
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-app-kit 0.2.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-metal"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-quartz-core"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
- "objc2-metal",
-]
-
-[[package]]
-name = "objc2-quartz-core"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
-dependencies = [
- "bitflags 2.10.0",
- "objc2 0.6.3",
- "objc2-core-foundation",
- "objc2-foundation 0.3.2",
-]
-
-[[package]]
-name = "objc2-symbols"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc"
-dependencies = [
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-ui-kit"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-cloud-kit",
- "objc2-core-data",
- "objc2-core-image",
- "objc2-core-location",
- "objc2-foundation 0.2.2",
- "objc2-link-presentation",
- "objc2-quartz-core 0.2.2",
- "objc2-symbols",
- "objc2-uniform-type-identifiers",
- "objc2-user-notifications",
-]
-
-[[package]]
-name = "objc2-uniform-type-identifiers"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe"
-dependencies = [
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc2-user-notifications"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3"
-dependencies = [
- "bitflags 2.10.0",
- "block2 0.5.1",
- "objc2 0.5.2",
- "objc2-core-location",
- "objc2-foundation 0.2.2",
-]
-
-[[package]]
-name = "objc_exception"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4"
-dependencies = [
- "cc",
+ "objc2",
]
[[package]]
@@ -6265,7 +4496,7 @@ checksum = "a45fa2aa886c42762255da344f0a0d313e254066c46aad76f300c3d3da62d967"
dependencies = [
"bitflags 2.10.0",
"cfg-if",
- "foreign-types 0.3.2",
+ "foreign-types",
"libc",
"openssl-macros",
"openssl-sys",
@@ -6312,36 +4543,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
-[[package]]
-name = "orbclient"
-version = "0.3.50"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52ad2c6bae700b7aa5d1cc30c59bdd3a1c180b09dbaea51e2ae2b8e1cf211fdd"
-dependencies = [
- "libc",
- "libredox",
-]
-
-[[package]]
-name = "ordered-multimap"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a"
-dependencies = [
- "dlv-list",
- "hashbrown 0.12.3",
-]
-
-[[package]]
-name = "ordered-stream"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
-dependencies = [
- "futures-core",
- "pin-project-lite",
-]
-
[[package]]
name = "orders-accounting"
version = "1.4.5"
@@ -6360,39 +4561,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "ouroboros"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e0f050db9c44b97a94723127e6be766ac5c340c48f2c4bb3ffa11713744be59"
-dependencies = [
- "aliasable",
- "ouroboros_macro",
- "static_assertions",
-]
-
-[[package]]
-name = "ouroboros_macro"
-version = "0.18.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c7028bdd3d43083f6d8d4d5187680d0d3560d54df4cc9d752005268b41e64d0"
-dependencies = [
- "heck 0.4.1",
- "proc-macro2",
- "proc-macro2-diagnostics",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "owned_ttf_parser"
-version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b"
-dependencies = [
- "ttf-parser 0.25.1",
-]
-
[[package]]
name = "p2p"
version = "1.4.5"
@@ -6503,30 +4671,6 @@ dependencies = [
"serialization",
]
-[[package]]
-name = "palette"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4cbf71184cc5ecc2e4e1baccdb21026c20e5fc3dcf63028a086131b3ab00b6e6"
-dependencies = [
- "approx",
- "fast-srgb8",
- "palette_derive",
- "phf 0.11.3",
-]
-
-[[package]]
-name = "palette_derive"
-version = "0.7.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5030daf005bface118c096f510ffb781fc28f9ab6a32ab224d8631be6851d30"
-dependencies = [
- "by_address",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
[[package]]
name = "parity-scale-codec"
version = "3.7.5"
@@ -6550,24 +4694,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "parking"
-version = "2.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
-
-[[package]]
-name = "parking_lot"
-version = "0.11.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
-dependencies = [
- "instant",
- "lock_api",
- "parking_lot_core 0.8.6",
+ "syn 2.0.114",
]
[[package]]
@@ -6577,21 +4704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"
dependencies = [
"lock_api",
- "parking_lot_core 0.9.12",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc"
-dependencies = [
- "cfg-if",
- "instant",
- "libc",
- "redox_syscall 0.2.16",
- "smallvec",
- "winapi",
+ "parking_lot_core",
]
[[package]]
@@ -6602,7 +4715,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall 0.5.18",
+ "redox_syscall",
"smallvec",
"windows-link 0.2.1",
]
@@ -6630,58 +4743,16 @@ version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
-[[package]]
-name = "phf"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
-dependencies = [
- "phf_macros",
- "phf_shared 0.11.3",
-]
-
[[package]]
name = "phf"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
dependencies = [
- "phf_shared 0.13.1",
+ "phf_shared",
"serde",
]
-[[package]]
-name = "phf_generator"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
-dependencies = [
- "phf_shared 0.11.3",
- "rand 0.8.6",
-]
-
-[[package]]
-name = "phf_macros"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"
-dependencies = [
- "phf_generator",
- "phf_shared 0.11.3",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
-dependencies = [
- "siphasher",
-]
-
[[package]]
name = "phf_shared"
version = "0.13.1"
@@ -6723,17 +4794,6 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
-[[package]]
-name = "piper"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
-dependencies = [
- "atomic-waker",
- "fastrand",
- "futures-io",
-]
-
[[package]]
name = "pkg-config"
version = "0.3.32"
@@ -6768,39 +4828,6 @@ dependencies = [
"plotters-backend",
]
-[[package]]
-name = "png"
-version = "0.17.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
-dependencies = [
- "bitflags 1.3.2",
- "crc32fast",
- "fdeflate",
- "flate2",
- "miniz_oxide",
-]
-
-[[package]]
-name = "polling"
-version = "3.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
-dependencies = [
- "cfg-if",
- "concurrent-queue",
- "hermit-abi",
- "pin-project-lite",
- "rustix 1.1.3",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "pollster"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f3a9f18d041e6d0e102a0a46750538147e5e8992d3b4873aaafee2520b00ce3"
-
[[package]]
name = "poly1305"
version = "0.8.0"
@@ -6949,12 +4976,6 @@ dependencies = [
"num-traits",
]
-[[package]]
-name = "presser"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
-
[[package]]
name = "prettyplease"
version = "0.2.37"
@@ -6997,33 +5018,14 @@ dependencies = [
"unicode-ident",
]
-[[package]]
-name = "proc-macro2-diagnostics"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "version_check",
- "yansi",
-]
-
-[[package]]
-name = "profiling"
-version = "1.0.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3eb8486b569e12e2c32ad3e204dbaba5e4b5b216e9367044f25f1dba42341773"
-
[[package]]
name = "proptest"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
dependencies = [
- "bit-set 0.8.0",
- "bit-vec 0.8.0",
+ "bit-set",
+ "bit-vec",
"bitflags 2.10.0",
"num-traits",
"rand 0.9.4",
@@ -7134,15 +5136,6 @@ version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-[[package]]
-name = "quick-xml"
-version = "0.38.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b66c2058c55a409d601666cffe35f04333cf1013010882cec174a7467cd4e21c"
-dependencies = [
- "memchr",
-]
-
[[package]]
name = "quote"
version = "1.0.44"
@@ -7269,24 +5262,6 @@ dependencies = [
"static_assertions",
]
-[[package]]
-name = "range-alloc"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d6831663a5098ea164f89cff59c6284e95f4e3c76ce9848d4529f5ccca9bde"
-
-[[package]]
-name = "rangemap"
-version = "1.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "973443cf09a9c8656b574a866ab68dfa19f0867d0340648c7d2f6a71b8a8ea68"
-
-[[package]]
-name = "raw-window-handle"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539"
-
[[package]]
name = "rayon"
version = "1.11.0"
@@ -7307,34 +5282,6 @@ dependencies = [
"crossbeam-utils",
]
-[[package]]
-name = "read-fonts"
-version = "0.22.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69aacb76b5c29acfb7f90155d39759a29496aebb49395830e928a9703d2eec2f"
-dependencies = [
- "bytemuck",
- "font-types",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
-dependencies = [
- "bitflags 1.3.2",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
-dependencies = [
- "bitflags 1.3.2",
-]
-
[[package]]
name = "redox_syscall"
version = "0.5.18"
@@ -7344,15 +5291,6 @@ dependencies = [
"bitflags 2.10.0",
]
-[[package]]
-name = "redox_syscall"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27"
-dependencies = [
- "bitflags 2.10.0",
-]
-
[[package]]
name = "redox_users"
version = "0.4.6"
@@ -7447,12 +5385,6 @@ dependencies = [
"bytecheck",
]
-[[package]]
-name = "renderdoc-sys"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
-
[[package]]
name = "reqwest"
version = "0.12.28"
@@ -7493,30 +5425,6 @@ dependencies = [
"web-sys",
]
-[[package]]
-name = "rfd"
-version = "0.15.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef2bee61e6cffa4635c72d7d81a84294e28f0930db0ddcb0f66d10244674ebed"
-dependencies = [
- "ashpd",
- "block2 0.6.2",
- "dispatch2",
- "js-sys",
- "log",
- "objc2 0.6.3",
- "objc2-app-kit 0.3.2",
- "objc2-core-foundation",
- "objc2-foundation 0.3.2",
- "pollster",
- "raw-window-handle",
- "urlencoding",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "windows-sys 0.59.0",
-]
-
[[package]]
name = "ring"
version = "0.17.14"
@@ -7584,12 +5492,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746"
-[[package]]
-name = "roxmltree"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
-
[[package]]
name = "rpassword"
version = "7.5.4"
@@ -7736,16 +5638,6 @@ dependencies = [
"smallvec",
]
-[[package]]
-name = "rust-ini"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df"
-dependencies = [
- "cfg-if",
- "ordered-multimap",
-]
-
[[package]]
name = "rust_decimal"
version = "1.40.0"
@@ -7762,12 +5654,6 @@ dependencies = [
"serde_json",
]
-[[package]]
-name = "rustc-hash"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
-
[[package]]
name = "rustc-hash"
version = "2.1.1"
@@ -7907,23 +5793,6 @@ dependencies = [
"wait-timeout",
]
-[[package]]
-name = "rustybuzz"
-version = "0.14.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c"
-dependencies = [
- "bitflags 2.10.0",
- "bytemuck",
- "libm",
- "smallvec",
- "ttf-parser 0.21.1",
- "unicode-bidi-mirroring",
- "unicode-ccc",
- "unicode-properties",
- "unicode-script",
-]
-
[[package]]
name = "ryu"
version = "1.0.23"
@@ -8022,19 +5891,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "sctk-adwaita"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6277f0217056f77f1d8f49f2950ac6c278c0d607c45f5ee99328d792ede24ec"
-dependencies = [
- "ab_glyph",
- "log",
- "memmap2",
- "smithay-client-toolkit 0.19.2",
- "tiny-skia",
-]
-
[[package]]
name = "seahash"
version = "4.1.0"
@@ -8097,12 +5953,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "self_cell"
-version = "1.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b12e76d157a900eb52e81bc6e9f3069344290341720e9178cde2407113ac8d89"
-
[[package]]
name = "semver"
version = "1.0.27"
@@ -8207,17 +6057,6 @@ dependencies = [
"serde_core",
]
-[[package]]
-name = "serde_repr"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
[[package]]
name = "serde_spanned"
version = "0.6.9"
@@ -8287,7 +6126,7 @@ dependencies = [
"futures-util",
"log",
"once_cell",
- "parking_lot 0.12.5",
+ "parking_lot",
"serial_test_derive",
]
@@ -8484,16 +6323,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
-[[package]]
-name = "skrifa"
-version = "0.22.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e1c44ad1f6c5bdd4eefed8326711b7dbda9ea45dfd36068c427d332aa382cbe"
-dependencies = [
- "bytemuck",
- "read-fonts",
-]
-
[[package]]
name = "slab"
version = "0.4.12"
@@ -8509,93 +6338,12 @@ dependencies = [
"crossbeam-channel",
]
-[[package]]
-name = "slotmap"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038"
-dependencies = [
- "version_check",
-]
-
[[package]]
name = "smallvec"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
-[[package]]
-name = "smithay-client-toolkit"
-version = "0.19.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016"
-dependencies = [
- "bitflags 2.10.0",
- "calloop 0.13.0",
- "calloop-wayland-source 0.3.0",
- "cursor-icon",
- "libc",
- "log",
- "memmap2",
- "rustix 0.38.44",
- "thiserror 1.0.69",
- "wayland-backend",
- "wayland-client",
- "wayland-csd-frame",
- "wayland-cursor",
- "wayland-protocols",
- "wayland-protocols-wlr",
- "wayland-scanner",
- "xkeysym",
-]
-
-[[package]]
-name = "smithay-client-toolkit"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0512da38f5e2b31201a93524adb8d3136276fa4fe4aafab4e1f727a82b534cc0"
-dependencies = [
- "bitflags 2.10.0",
- "calloop 0.14.3",
- "calloop-wayland-source 0.4.1",
- "cursor-icon",
- "libc",
- "log",
- "memmap2",
- "rustix 1.1.3",
- "thiserror 2.0.18",
- "wayland-backend",
- "wayland-client",
- "wayland-csd-frame",
- "wayland-cursor",
- "wayland-protocols",
- "wayland-protocols-experimental",
- "wayland-protocols-misc",
- "wayland-protocols-wlr",
- "wayland-scanner",
- "xkeysym",
-]
-
-[[package]]
-name = "smithay-clipboard"
-version = "0.7.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71704c03f739f7745053bde45fa203a46c58d25bc5c4efba1d9a60e9dba81226"
-dependencies = [
- "libc",
- "smithay-client-toolkit 0.20.0",
- "wayland-backend",
-]
-
-[[package]]
-name = "smol_str"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "snow"
version = "0.9.7"
@@ -8644,40 +6392,8 @@ version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
- "libc",
- "windows-sys 0.61.2",
-]
-
-[[package]]
-name = "softbuffer"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3"
-dependencies = [
- "as-raw-xcb-connection",
- "bytemuck",
- "drm",
- "fastrand",
- "js-sys",
- "memmap2",
- "ndk",
- "objc2 0.6.3",
- "objc2-core-foundation",
- "objc2-core-graphics",
- "objc2-foundation 0.3.2",
- "objc2-quartz-core 0.3.2",
- "raw-window-handle",
- "redox_syscall 0.5.18",
- "rustix 1.1.3",
- "tiny-xlib",
- "tracing",
- "wasm-bindgen",
- "wayland-backend",
- "wayland-client",
- "wayland-sys",
- "web-sys",
+ "libc",
"windows-sys 0.61.2",
- "x11rb",
]
[[package]]
@@ -8696,15 +6412,6 @@ dependencies = [
"sha1",
]
-[[package]]
-name = "spirv"
-version = "0.3.0+sdk-1.3.268.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
-dependencies = [
- "bitflags 2.10.0",
-]
-
[[package]]
name = "stable_deref_trait"
version = "1.2.1"
@@ -8809,12 +6516,6 @@ dependencies = [
"utils",
]
-[[package]]
-name = "strict-num"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
-
[[package]]
name = "stringprep"
version = "0.1.5"
@@ -8871,7 +6572,7 @@ version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
dependencies = [
- "heck 0.5.0",
+ "heck",
"proc-macro2",
"quote",
"rustversion",
@@ -8884,7 +6585,7 @@ version = "0.27.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7"
dependencies = [
- "heck 0.5.0",
+ "heck",
"proc-macro2",
"quote",
"syn 2.0.114",
@@ -8918,23 +6619,6 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
-[[package]]
-name = "svg_fmt"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"
-
-[[package]]
-name = "swash"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbd59f3f359ddd2c95af4758c18270eddd9c730dde98598023cdabff472c2ca2"
-dependencies = [
- "skrifa",
- "yazi",
- "zeno",
-]
-
[[package]]
name = "syn"
version = "1.0.109"
@@ -8988,15 +6672,6 @@ dependencies = [
"syn 2.0.114",
]
-[[package]]
-name = "sys-locale"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4"
-dependencies = [
- "libc",
-]
-
[[package]]
name = "system-configuration"
version = "0.7.0"
@@ -9048,15 +6723,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "termcolor"
-version = "1.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
-dependencies = [
- "winapi-util",
-]
-
[[package]]
name = "termtree"
version = "0.5.1"
@@ -9193,45 +6859,6 @@ dependencies = [
"time-core",
]
-[[package]]
-name = "tiny-skia"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
-dependencies = [
- "arrayref",
- "arrayvec",
- "bytemuck",
- "cfg-if",
- "log",
- "png",
- "tiny-skia-path",
-]
-
-[[package]]
-name = "tiny-skia-path"
-version = "0.11.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
-dependencies = [
- "arrayref",
- "bytemuck",
- "strict-num",
-]
-
-[[package]]
-name = "tiny-xlib"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0324504befd01cab6e0c994f34b2ffa257849ee019d3fb3b64fb2c858887d89e"
-dependencies = [
- "as-raw-xcb-connection",
- "ctor-lite",
- "libloading 0.8.9",
- "pkg-config",
- "tracing",
-]
-
[[package]]
name = "tinystr"
version = "0.8.2"
@@ -9295,7 +6922,7 @@ dependencies = [
"bytes",
"libc",
"mio",
- "parking_lot 0.12.5",
+ "parking_lot",
"pin-project-lite",
"signal-hook-registry",
"socket2 0.6.5",
@@ -9338,9 +6965,9 @@ dependencies = [
"futures-channel",
"futures-util",
"log",
- "parking_lot 0.12.5",
+ "parking_lot",
"percent-encoding",
- "phf 0.13.1",
+ "phf",
"pin-project-lite",
"postgres-protocol",
"postgres-types",
@@ -9399,15 +7026,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "toml"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
-dependencies = [
- "serde",
-]
-
[[package]]
name = "toml"
version = "0.8.23"
@@ -9708,24 +7326,6 @@ dependencies = [
"syn 2.0.114",
]
-[[package]]
-name = "ttf-parser"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4"
-
-[[package]]
-name = "ttf-parser"
-version = "0.21.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8"
-
-[[package]]
-name = "ttf-parser"
-version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31"
-
[[package]]
name = "tx-verifier"
version = "1.4.5"
@@ -9778,17 +7378,6 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
-[[package]]
-name = "uds_windows"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
-dependencies = [
- "memoffset",
- "tempfile",
- "winapi",
-]
-
[[package]]
name = "unarray"
version = "0.1.4"
@@ -9801,30 +7390,12 @@ version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5"
-[[package]]
-name = "unicode-bidi-mirroring"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86"
-
-[[package]]
-name = "unicode-ccc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656"
-
[[package]]
name = "unicode-ident"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"
-[[package]]
-name = "unicode-linebreak"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
-
[[package]]
name = "unicode-normalization"
version = "0.1.25"
@@ -9840,12 +7411,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d"
-[[package]]
-name = "unicode-script"
-version = "0.5.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "383ad40bb927465ec0ce7720e033cb4ca06912855fc35db31b5755d0de75b1ee"
-
[[package]]
name = "unicode-segmentation"
version = "1.12.0"
@@ -9905,12 +7470,6 @@ dependencies = [
"serde_derive",
]
-[[package]]
-name = "urlencoding"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
-
[[package]]
name = "utf8-width"
version = "0.1.8"
@@ -9941,7 +7500,7 @@ dependencies = [
"directories",
"fix-hidden-lifetime-bug",
"fixed-hash",
- "heck 0.5.0",
+ "heck",
"log_error",
"logging",
"loom",
@@ -10003,7 +7562,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f"
dependencies = [
"js-sys",
- "serde_core",
"wasm-bindgen",
]
@@ -10615,21 +8173,6 @@ dependencies = [
"wasmparser",
]
-[[package]]
-name = "wasm-timer"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f"
-dependencies = [
- "futures",
- "js-sys",
- "parking_lot 0.11.2",
- "pin-utils",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
-]
-
[[package]]
name = "wasm-wrappers"
version = "1.4.5"
@@ -10673,141 +8216,6 @@ dependencies = [
"semver",
]
-[[package]]
-name = "wayland-backend"
-version = "0.3.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fee64194ccd96bf648f42a65a7e589547096dfa702f7cadef84347b66ad164f9"
-dependencies = [
- "cc",
- "downcast-rs",
- "rustix 1.1.3",
- "scoped-tls",
- "smallvec",
- "wayland-sys",
-]
-
-[[package]]
-name = "wayland-client"
-version = "0.31.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8e6faa537fbb6c186cb9f1d41f2f811a4120d1b57ec61f50da451a0c5122bec"
-dependencies = [
- "bitflags 2.10.0",
- "rustix 1.1.3",
- "wayland-backend",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-csd-frame"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e"
-dependencies = [
- "bitflags 2.10.0",
- "cursor-icon",
- "wayland-backend",
-]
-
-[[package]]
-name = "wayland-cursor"
-version = "0.31.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5864c4b5b6064b06b1e8b74ead4a98a6c45a285fe7a0e784d24735f011fdb078"
-dependencies = [
- "rustix 1.1.3",
- "wayland-client",
- "xcursor",
-]
-
-[[package]]
-name = "wayland-protocols"
-version = "0.32.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baeda9ffbcfc8cd6ddaade385eaf2393bd2115a69523c735f12242353c3df4f3"
-dependencies = [
- "bitflags 2.10.0",
- "wayland-backend",
- "wayland-client",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-protocols-experimental"
-version = "20250721.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40a1f863128dcaaec790d7b4b396cc9b9a7a079e878e18c47e6c2d2c5a8dcbb1"
-dependencies = [
- "bitflags 2.10.0",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-protocols-misc"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791c58fdeec5406aa37169dd815327d1e47f334219b523444bc26d70ceb4c34e"
-dependencies = [
- "bitflags 2.10.0",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-protocols-plasma"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa98634619300a535a9a97f338aed9a5ff1e01a461943e8346ff4ae26007306b"
-dependencies = [
- "bitflags 2.10.0",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-protocols-wlr"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9597cdf02cf0c34cd5823786dce6b5ae8598f05c2daf5621b6e178d4f7345f3"
-dependencies = [
- "bitflags 2.10.0",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "wayland-scanner",
-]
-
-[[package]]
-name = "wayland-scanner"
-version = "0.31.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5423e94b6a63e68e439803a3e153a9252d5ead12fd853334e2ad33997e3889e3"
-dependencies = [
- "proc-macro2",
- "quick-xml",
- "quote",
-]
-
-[[package]]
-name = "wayland-sys"
-version = "0.31.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6dbfc3ac5ef974c92a2235805cc0114033018ae1290a72e474aa8b28cbbdfd"
-dependencies = [
- "dlib",
- "log",
- "once_cell",
- "pkg-config",
-]
-
[[package]]
name = "web-sys"
version = "0.3.85"
@@ -10819,138 +8227,21 @@ dependencies = [
]
[[package]]
-name = "web-time"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "webpki-root-certs"
-version = "0.26.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e"
-dependencies = [
- "webpki-root-certs 1.0.11",
-]
-
-[[package]]
-name = "webpki-root-certs"
-version = "1.0.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a"
-dependencies = [
- "rustls-pki-types",
-]
-
-[[package]]
-name = "wgpu"
-version = "0.19.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01"
-dependencies = [
- "arrayvec",
- "cfg-if",
- "cfg_aliases 0.1.1",
- "js-sys",
- "log",
- "naga",
- "parking_lot 0.11.2",
- "profiling",
- "raw-window-handle",
- "smallvec",
- "static_assertions",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "web-sys",
- "wgpu-core",
- "wgpu-hal",
- "wgpu-types",
-]
-
-[[package]]
-name = "wgpu-core"
-version = "0.19.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a"
-dependencies = [
- "arrayvec",
- "bit-vec 0.6.3",
- "bitflags 2.10.0",
- "cfg_aliases 0.1.1",
- "codespan-reporting",
- "indexmap 2.13.0",
- "log",
- "naga",
- "once_cell",
- "parking_lot 0.11.2",
- "profiling",
- "raw-window-handle",
- "rustc-hash 1.1.0",
- "smallvec",
- "thiserror 1.0.69",
- "web-sys",
- "wgpu-hal",
- "wgpu-types",
-]
-
-[[package]]
-name = "wgpu-hal"
-version = "0.19.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bfabcfc55fd86611a855816326b2d54c3b2fd7972c27ce414291562650552703"
-dependencies = [
- "android_system_properties",
- "arrayvec",
- "ash",
- "bit-set 0.5.3",
- "bitflags 2.10.0",
- "block",
- "cfg_aliases 0.1.1",
- "core-graphics-types",
- "d3d12",
- "glow",
- "glutin_wgl_sys",
- "gpu-alloc",
- "gpu-allocator",
- "gpu-descriptor",
- "hassle-rs",
- "js-sys",
- "khronos-egl",
- "libc",
- "libloading 0.8.9",
- "log",
- "metal",
- "naga",
- "ndk-sys 0.5.0+25.2.9519653",
- "objc",
- "once_cell",
- "parking_lot 0.11.2",
- "profiling",
- "range-alloc",
- "raw-window-handle",
- "renderdoc-sys",
- "rustc-hash 1.1.0",
- "smallvec",
- "thiserror 1.0.69",
- "wasm-bindgen",
- "web-sys",
- "wgpu-types",
- "winapi",
-]
-
-[[package]]
-name = "wgpu-types"
-version = "0.19.2"
+name = "webpki-root-certs"
+version = "0.26.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805"
+checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e"
dependencies = [
- "bitflags 2.10.0",
- "js-sys",
- "web-sys",
+ "webpki-root-certs 1.0.11",
+]
+
+[[package]]
+name = "webpki-root-certs"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a"
+dependencies = [
+ "rustls-pki-types",
]
[[package]]
@@ -10964,12 +8255,6 @@ dependencies = [
"web-sys",
]
-[[package]]
-name = "widestring"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471"
-
[[package]]
name = "winapi"
version = "0.3.9"
@@ -11001,30 +8286,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-[[package]]
-name = "window_clipboard"
-version = "0.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6d692d46038c433f9daee7ad8757e002a4248c20b0a3fbc991d99521d3bcb6d"
-dependencies = [
- "clipboard-win",
- "clipboard_macos",
- "clipboard_wayland",
- "clipboard_x11",
- "raw-window-handle",
- "thiserror 1.0.69",
-]
-
-[[package]]
-name = "windows"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
-dependencies = [
- "windows-core 0.52.0",
- "windows-targets 0.52.6",
-]
-
[[package]]
name = "windows"
version = "0.61.3"
@@ -11032,7 +8293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
dependencies = [
"windows-collections",
- "windows-core 0.61.2",
+ "windows-core",
"windows-future",
"windows-link 0.1.3",
"windows-numerics",
@@ -11044,16 +8305,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
dependencies = [
- "windows-core 0.61.2",
-]
-
-[[package]]
-name = "windows-core"
-version = "0.52.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
-dependencies = [
- "windows-targets 0.52.6",
+ "windows-core",
]
[[package]]
@@ -11075,7 +8327,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
dependencies = [
- "windows-core 0.61.2",
+ "windows-core",
"windows-link 0.1.3",
"windows-threading",
]
@@ -11120,7 +8372,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
dependencies = [
- "windows-core 0.61.2",
+ "windows-core",
"windows-link 0.1.3",
]
@@ -11403,58 +8655,6 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
-[[package]]
-name = "winit"
-version = "0.30.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c66d4b9ed69c4009f6321f762d6e61ad8a2389cd431b97cb1e146812e9e6c732"
-dependencies = [
- "ahash 0.8.12",
- "android-activity",
- "atomic-waker",
- "bitflags 2.10.0",
- "block2 0.5.1",
- "bytemuck",
- "calloop 0.13.0",
- "cfg_aliases 0.2.1",
- "concurrent-queue",
- "core-foundation 0.9.4",
- "core-graphics",
- "cursor-icon",
- "dpi",
- "js-sys",
- "libc",
- "memmap2",
- "ndk",
- "objc2 0.5.2",
- "objc2-app-kit 0.2.2",
- "objc2-foundation 0.2.2",
- "objc2-ui-kit",
- "orbclient",
- "percent-encoding",
- "pin-project",
- "raw-window-handle",
- "redox_syscall 0.4.1",
- "rustix 0.38.44",
- "sctk-adwaita",
- "smithay-client-toolkit 0.19.2",
- "smol_str",
- "tracing",
- "unicode-segmentation",
- "wasm-bindgen",
- "wasm-bindgen-futures",
- "wayland-backend",
- "wayland-client",
- "wayland-protocols",
- "wayland-protocols-plasma",
- "web-sys",
- "web-time",
- "windows-sys 0.52.0",
- "x11-dl",
- "x11rb",
- "xkbcommon-dl",
-]
-
[[package]]
name = "winnow"
version = "0.7.14"
@@ -11464,24 +8664,6 @@ dependencies = [
"memchr",
]
-[[package]]
-name = "winreg"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winres"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
-dependencies = [
- "toml 0.5.11",
-]
-
[[package]]
name = "wit-bindgen"
version = "0.51.0"
@@ -11498,7 +8680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
dependencies = [
"anyhow",
- "heck 0.5.0",
+ "heck",
"wit-parser",
]
@@ -11509,7 +8691,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
dependencies = [
"anyhow",
- "heck 0.5.0",
+ "heck",
"indexmap 2.13.0",
"prettyplease",
"syn 2.0.114",
@@ -11585,38 +8767,6 @@ dependencies = [
"tap",
]
-[[package]]
-name = "x11-dl"
-version = "2.21.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f"
-dependencies = [
- "libc",
- "once_cell",
- "pkg-config",
-]
-
-[[package]]
-name = "x11rb"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9993aa5be5a26815fe2c3eacfc1fde061fc1a1f094bf1ad2a18bf9c495dd7414"
-dependencies = [
- "as-raw-xcb-connection",
- "gethostname",
- "libc",
- "libloading 0.8.9",
- "once_cell",
- "rustix 1.1.3",
- "x11rb-protocol",
-]
-
-[[package]]
-name = "x11rb-protocol"
-version = "0.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
-
[[package]]
name = "x25519-dalek"
version = "2.0.1"
@@ -11629,65 +8779,12 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "xcursor"
-version = "0.3.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b"
-
-[[package]]
-name = "xdg-home"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"
-dependencies = [
- "libc",
- "windows-sys 0.59.0",
-]
-
-[[package]]
-name = "xkbcommon-dl"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5"
-dependencies = [
- "bitflags 2.10.0",
- "dlib",
- "log",
- "once_cell",
- "xkeysym",
-]
-
-[[package]]
-name = "xkeysym"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
-
[[package]]
name = "xml"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8aa498d22c9bbaf482329839bc5620c46be275a19a812e9a22a2b07529a642a"
-[[package]]
-name = "xml-rs"
-version = "0.8.28"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f"
-
-[[package]]
-name = "yansi"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
-
-[[package]]
-name = "yazi"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1"
-
[[package]]
name = "yoke"
version = "0.8.1"
@@ -11711,130 +8808,6 @@ dependencies = [
"synstructure",
]
-[[package]]
-name = "zbus"
-version = "4.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725"
-dependencies = [
- "async-broadcast",
- "async-executor",
- "async-fs",
- "async-io",
- "async-lock",
- "async-process",
- "async-recursion",
- "async-task",
- "async-trait",
- "blocking",
- "enumflags2",
- "event-listener",
- "futures-core",
- "futures-sink",
- "futures-util",
- "hex",
- "nix",
- "ordered-stream",
- "rand 0.8.6",
- "serde",
- "serde_repr",
- "sha1",
- "static_assertions",
- "tracing",
- "uds_windows",
- "windows-sys 0.52.0",
- "xdg-home",
- "zbus_macros 4.4.0",
- "zbus_names 3.0.0",
- "zvariant 4.2.0",
-]
-
-[[package]]
-name = "zbus"
-version = "5.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bfeff997a0aaa3eb20c4652baf788d2dfa6d2839a0ead0b3ff69ce2f9c4bdd1"
-dependencies = [
- "async-broadcast",
- "async-recursion",
- "async-trait",
- "enumflags2",
- "event-listener",
- "futures-core",
- "futures-lite",
- "hex",
- "libc",
- "ordered-stream",
- "rustix 1.1.3",
- "serde",
- "serde_repr",
- "tokio",
- "tracing",
- "uds_windows",
- "uuid",
- "windows-sys 0.61.2",
- "winnow",
- "zbus_macros 5.13.2",
- "zbus_names 4.3.1",
- "zvariant 5.9.2",
-]
-
-[[package]]
-name = "zbus_macros"
-version = "4.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "zvariant_utils 2.1.0",
-]
-
-[[package]]
-name = "zbus_macros"
-version = "5.13.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bbd5a90dbe8feee5b13def448427ae314ccd26a49cac47905cafefb9ff846f1"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "zbus_names 4.3.1",
- "zvariant 5.9.2",
- "zvariant_utils 3.3.0",
-]
-
-[[package]]
-name = "zbus_names"
-version = "3.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c"
-dependencies = [
- "serde",
- "static_assertions",
- "zvariant 4.2.0",
-]
-
-[[package]]
-name = "zbus_names"
-version = "4.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f"
-dependencies = [
- "serde",
- "winnow",
- "zvariant 5.9.2",
-]
-
-[[package]]
-name = "zeno"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd15f8e0dbb966fd9245e7498c7e9e5055d9e5c8b676b95bd67091cd11a1e697"
-
[[package]]
name = "zerocopy"
version = "0.8.39"
@@ -11934,81 +8907,3 @@ name = "zmij"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7"
-
-[[package]]
-name = "zvariant"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe"
-dependencies = [
- "endi",
- "enumflags2",
- "serde",
- "static_assertions",
- "zvariant_derive 4.2.0",
-]
-
-[[package]]
-name = "zvariant"
-version = "5.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68b64ef4f40c7951337ddc7023dd03528a57a3ce3408ee9da5e948bd29b232c4"
-dependencies = [
- "endi",
- "enumflags2",
- "serde",
- "url",
- "winnow",
- "zvariant_derive 5.9.2",
- "zvariant_utils 3.3.0",
-]
-
-[[package]]
-name = "zvariant_derive"
-version = "4.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "zvariant_utils 2.1.0",
-]
-
-[[package]]
-name = "zvariant_derive"
-version = "5.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "484d5d975eb7afb52cc6b929c13d3719a20ad650fea4120e6310de3fc55e415c"
-dependencies = [
- "proc-macro-crate",
- "proc-macro2",
- "quote",
- "syn 2.0.114",
- "zvariant_utils 3.3.0",
-]
-
-[[package]]
-name = "zvariant_utils"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.114",
-]
-
-[[package]]
-name = "zvariant_utils"
-version = "3.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9"
-dependencies = [
- "proc-macro2",
- "quote",
- "serde",
- "syn 2.0.114",
- "winnow",
-]
diff --git a/Cargo.toml b/Cargo.toml
index 57ce7ff802..69f872489a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,9 +32,7 @@ members = [
"mocks", # Mock implementations of our traits (used for testing).
"node-daemon", # Node terminal binary.
"networking", # Pure networking implementations
- "node-gui", # Node GUI binary.
- "node-gui/backend", # Node GUI backend, common logic for implementing GUI clients.
- "node-lib", # Node lib; the common library between daemon, tui and gui node executables.
+ "node-lib", # Node lib; the common library for node executables.
"orders-accounting", # Orders accounting
"p2p", # P2p communication interfaces and protocols.
"p2p/backend-test-suite", # P2p backend agnostic tests.
@@ -97,7 +95,6 @@ default-members = [
"mempool",
"networking",
"node-daemon",
- "node-gui",
"node-lib",
"p2p",
"rpc",
@@ -198,28 +195,6 @@ hickory-server = "0.26"
hmac = "0.12"
http = "1.3"
hyper = "1.7"
-iced = "0.13"
-# Note: we need this fix - https://github.com/iced-rs/iced_aw/pull/329
-# TODO: switch back to a released version of iced_aw once the fix is released (need version > 0.12)
-iced_aw = { git = "https://github.com/iced-rs/iced_aw", rev = "def1db9aac1e58a47e0c3127d4d4e95d724ca8ad", default-features = false, features = [
- "badge",
- "card",
- "number_input",
- "color_picker",
- "grid",
- "tab_bar",
- "tabs",
- "slide_bar",
- "wrap",
- "selection_list",
- "quad",
- "context_menu",
- "spinner",
- "drop_down",
- "menu",
- "sidebar",
-] }
-iced_fonts = "0.1"
indoc = "2.0"
itertools = "0.14"
jiff = "1.0"
@@ -255,7 +230,6 @@ ref-cast = "1.0"
regex = "1.10"
replace_with = "0.1"
reqwest = "0.12"
-rfd = { version = "0.15", default-features = false }
ripemd = "0.1"
rlimit = "0.10"
rpassword = "7.2"
@@ -342,12 +316,6 @@ git = "https://github.com/mintlayer/mintlayer-trezor-firmware"
rev = "0e6c4d46ff75a94164f07c9bf0bd95cdba81fea3"
features = ["bitcoin", "mintlayer"]
-[workspace.metadata.dist.dependencies.apt]
-"libatk1.0-0" = "*"
-"libatk1.0-dev" = "*"
-"libgdk3.0-cil" = '*'
-"libgdk3.0-cil-dev" = "*"
-
[profile.dev]
panic = "abort" # prevent panic catching (mostly for the tokio runtime)
@@ -374,16 +342,6 @@ overflow-checks = true
opt-level = 2
[patch.crates-io]
-# Using fontconfig-parser v0.5.8 completely breaks UI in node-gui on Linux - most of the text disappears and the few
-# characters that remain have broken spacing, so we force the usage of v0.5.7 via "patch".
-# Note: the commit is called "Bump version" and it's where the version was bumped to "0.5.7"; it is the last "good"
-# revision. The following ("bad") revision belongs to the PR https://github.com/Riey/fontconfig-parser/pull/11 which
-# claims to fix certain issues. So it's possible that fontconfig-parser v0.5.8 is actually good, but a dependent crate
-# uses it incorrectly (so v0.5.7 works only because several bugs cancel each other out). The current dependency chain
-# is fontconfig-parser <- fontdb <- cosmic-text <- various "iced" crates.
-# TODO: investigate this further.
-fontconfig-parser = { git = "https://github.com/Riey/fontconfig-parser", rev = "f7d13a779e6ee282ce75acbc00a1270c0350e0c2" }
-
# This patch is needed because there is no release of the library and because ledger-lib depends on ledger-proto, so this
# is the only way to make the former find the latter.
# Note that the revision specified here must be the same as the one used in the workspace.dependencies section.
@@ -394,9 +352,4 @@ ledger-proto = { git = "https://github.com/ledger-community/rust-ledger.git", re
# Note that the fix is needed for the Ledger app, but we have to use the same version of parity-scale-codec
# across Trezor, Ledger, mintlayer-core and mintlayer-core-primitives repos.
parity-scale-codec = { git = "https://github.com/paritytech/parity-scale-codec.git", rev = "5021525697edc0661591ebc71392c48d950a10b0" }
-# Fork of iced_glyphon 0.6.0 with the lru dependency upgraded to 0.16.3 to pick up the fix
-# for RUSTSEC-2026-0002 ("IterMut violates Stacked Borrows by invalidating internal pointer").
-# Upstream has replaced the crate with "cryoglyph" in unreleased iced 0.15, so there is no
-# upstream release with the fix. Drop this patch once iced ships one.
-iced_glyphon = { git = "https://github.com/mintlayer/iced-glyphon", rev = "acb3fc10a3a15ee6e0e7da4e264db2338c09a7c1" }
diff --git a/README.md b/README.md
index 2fa65db28d..fa3adc181e 100644
--- a/README.md
+++ b/README.md
@@ -24,8 +24,7 @@ To run a mainnet or testnet node, you have the option to use pre-built binaries
You can see the full list of mintlayer executables by running `cargo run --bin`, assuming you have rust installed. Rust will list all the possible executables. The following are the most important:
-- `node-daemon`: The node software as a command line tool. This is the software that manages the blocks, p2p communication, and all the other important functions of the blockchain network. The `node-daemon` is at the center of all other executables, except for the GUI, which has an instance of the node included in it for simplicity.
-- `node-gui`: The graphical user interface of the node for people who are not as tech-savvy and just want to run a node using the simplest means possible. The GUI is almost always behind in development compared to other tools, but it contains what is necessary to run a node, stake, delegate, and do other important tasks. The GUI also contains the machinery to run a wallet and create one. You can open multiple wallets with the GUI.
+- `node-daemon`: The node software as a command line tool. This is the software that manages the blocks, p2p communication, and all the other important functions of the blockchain network. The `node-daemon` is at the center of all other executables.
- `wallet-rpc-daemon`: A wallet that can be controlled remotely using RPC. This can be run as a service.
- `wallet-cli`: A command line interface for the wallet. All the newest features and functionalities of the wallet are available in this wallet. The `wallet-cli` is extremely ubiquitous and can be run in many modes, including a self-contained wallet, a controller of an RPC wallet, as an RPC wallet itself, and also as a cold wallet for air-gapped storage of coins and assets.
@@ -37,7 +36,6 @@ You can:
- Run node-daemon + wallet-cli to manage your coins, where wallet-cli owns your wallet file and manages your coins. wallet-cli itself can optionally act as an RPC server
- Run node-daemon + wallet-rpc-daemon + wallet-cli, where both daemons will be services in your system, wallet-rpc-daemon will own your wallet (and start staking automatically for you), and wallet-cli will just be an easy interface for communicating with your wallet
-- Run only node-gui, where the GUI contains both the node and the wallet. This is a good option for non-techy users
- Run node-daemon with the API server components ([see this readme](api-server/README.md)) without a wallet, to manage your application
### Preparations for compiling the source code
@@ -60,8 +58,8 @@ Additionally, independent of what is printed to the console, node's logs may als
by default, on Linux they will appear inside `~/.mintlayer/mainnet/logs/` and `~/.mintlayer/testnet/logs/`
and on Windows in `C:\Users\Username\AppData\Roaming\Mintlayer\mainnet\logs` and `C:\Users\Username\AppData\Roaming\Mintlayer\testnet\logs`
(for mainnet and testnet respectively).
-This is controlled by the `--log-to-file` option (e.g. `--log-to-file true`), which is accepted by both node-daemon and node-gui.
-By default, its value is false for node-daemon and true for node-gui. The log files are rotated based on size, so older logs
+This is controlled by the `--log-to-file` option (e.g. `--log-to-file true`), which is accepted by node-daemon.
+By default, its value is false. The log files are rotated based on size, so older logs
will be automatically deleted eventually. Also note that the log level used in this case is always `info`, regardless of the value of `RUST_LOG`.
The location and format of the log file (`text` or `json`), the rotation limits and the extra fields added to every line can be
configured with further options or in the `[logging]` section of `config.toml`; see the [node-daemon logging documentation](node-daemon/docs/README.md#logging).
@@ -103,10 +101,6 @@ Note: spaces don't matter, so these are aligned for readability
```sh
cargo run --release --bin wallet-rpc-daemon -- testnet 2>&1 | tee ../wallet-cli.log
```
-- GUI:
- ```sh
- cargo run --release --bin node-gui -- testnet 2>&1 | tee ../node-gui.log
- ```
For heavy debugging operation
- Node daemon:
@@ -121,10 +115,6 @@ For heavy debugging operation
```sh
RUST_LOG=debug cargo run --bin wallet-rpc-daemon -- testnet 2>&1 | tee ../wallet-cli.log
```
-- GUI:
- ```sh
- RUST_LOG=debug cargo run --bin node-gui -- testnet 2>&1 | tee ../node-gui.log
- ```
More complex log filtering is possible, e.g. you can filter out log lines produced by a certain crate or module, but this is out of scope of this document.
diff --git a/build-tools/assets/logo.icns b/build-tools/assets/logo.icns
deleted file mode 100644
index 50587c1054..0000000000
Binary files a/build-tools/assets/logo.icns and /dev/null differ
diff --git a/build-tools/assets/logo.ico b/build-tools/assets/logo.ico
deleted file mode 100644
index 48fd184076..0000000000
Binary files a/build-tools/assets/logo.ico and /dev/null differ
diff --git a/build-tools/assets/node-gui-icon_512.png b/build-tools/assets/node-gui-icon_512.png
deleted file mode 100644
index 3a00b78264..0000000000
Binary files a/build-tools/assets/node-gui-icon_512.png and /dev/null differ
diff --git a/build-tools/codecheck/codecheck.py b/build-tools/codecheck/codecheck.py
index 76ec428ce1..10bddaf8ea 100755
--- a/build-tools/codecheck/codecheck.py
+++ b/build-tools/codecheck/codecheck.py
@@ -383,7 +383,6 @@ def check_trailing_whitespaces():
'script/src/test/test_vectors_4opc.csv.gz',
'wasm-wrappers/doc/*',
'build-tools/assets/*',
- 'build-tools/osx/DeveloperIDG2CA.cer'
]
ok = True
diff --git a/build-tools/docker/BUILD.md b/build-tools/docker/BUILD.md
index 6c9f2b061a..e381795f79 100644
--- a/build-tools/docker/BUILD.md
+++ b/build-tools/docker/BUILD.md
@@ -1,6 +1,6 @@
# Building Docker Images for Mintlayer
-This document outlines the steps to build Docker images for the Mintlayer node daemon, wallet-cli, and node-gui.
+This document outlines the steps to build Docker images for the Mintlayer node daemon and wallet-cli.
Before building make sure you clone the repository and change the current directory in the root of the repository.
@@ -34,6 +34,5 @@ The result should similar to the following:
```
$ docker images |grep mintlayer
mintlayer/wallet-cli 0.5.1 57dcc4898a30 2 minutes ago 125MB
-mintlayer/node-gui 0.5.1 a2ed3937e081 2 minutes ago 290MB
mintlayer/node-daemon 0.5.1 ad830bf576e3 3 minutes ago 119MB
```
diff --git a/build-tools/osx/DeveloperIDG2CA.cer b/build-tools/osx/DeveloperIDG2CA.cer
deleted file mode 100644
index 8cbcf6f46c..0000000000
Binary files a/build-tools/osx/DeveloperIDG2CA.cer and /dev/null differ
diff --git a/build-tools/osx/Info.plist.template b/build-tools/osx/Info.plist.template
deleted file mode 100644
index be5a2a7a40..0000000000
--- a/build-tools/osx/Info.plist.template
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- English
- CFBundleDisplayName
- Mintlayer Node GUI
- CFBundleIdentifier
- org.mintlayer.mintlayer-core.node-gui
- CFBundleExecutable
- node-gui
- CFBundleIconFile
- logo.icns
- CFBundleIdentifier
- org.mintlayer.NodeGUI
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- Mintlayer Node GUI
- CFBundlePackageType
- APPL
- CFBundleShortVersionString
- VERSION_PLACEHOLDER
- CFBundleVersion
- BUILD_PLACEHOLDER
- LSMinimumSystemVersion
- 10.13
- NSHighResolutionCapable
-
- NSSupportsAutomaticGraphicsSwitching
-
- LSApplicationCategoryType
- public.app-category.finance
- NSAppleEventsUsageDescription
- This app requires access to send Apple Events for automation purposes.
-
-
\ No newline at end of file
diff --git a/build-tools/osx/entitlements.plist b/build-tools/osx/entitlements.plist
deleted file mode 100644
index 9c6d9793e3..0000000000
--- a/build-tools/osx/entitlements.plist
+++ /dev/null
@@ -1,51 +0,0 @@
-
-
-
-
-
- com.apple.security.files.user-selected.read-write
-
- com.apple.security.files.user-selected.read-only
-
- com.apple.security.files.downloads.read-write
-
-
-
- com.apple.security.network.client
-
- com.apple.security.network.server
-
-
-
- com.apple.security.device.audio-input
-
- com.apple.security.device.camera
-
- com.apple.security.device.usb
-
- com.apple.security.device.print
-
-
-
- com.apple.security.cs.allow-jit
-
- com.apple.security.cs.allow-unsigned-executable-memory
-
- com.apple.security.cs.allow-dyld-environment-variables
-
- com.apple.security.cs.disable-library-validation
-
-
-
- com.apple.security.get-task-allow
-
-
-
- com.apple.security.personal-information.addressbook
-
- com.apple.security.personal-information.calendars
-
- com.apple.security.personal-information.location
-
-
-
\ No newline at end of file
diff --git a/build-tools/osx/sign_and_notarize.sh b/build-tools/osx/sign_and_notarize.sh
deleted file mode 100755
index 8f61b007ff..0000000000
--- a/build-tools/osx/sign_and_notarize.sh
+++ /dev/null
@@ -1,242 +0,0 @@
-#!/bin/bash
-
-set -e
-set -o nounset
-
-ARCH=$1
-VERSION=$2
-
-# Configuration
-APP_NAME="Mintlayer Node GUI"
-DMG_NAME="Mintlayer_Node_GUI_macos_${VERSION}_${ARCH}.dmg"
-KEYCHAIN_NAME="build.keychain"
-KEYCHAIN_PASSWORD="temporary_password"
-NOTARIZATION_TIMEOUT=300 # Maximum wait time for notarization in seconds
-
-# Function to display usage information
-usage() {
- echo "Usage: $0 "
- echo " architecture: aarch64 or x86_64"
- echo " version: in the format x.y.z"
- echo
- echo "Environment variables (can be set in .env file):"
- echo " MACOS_CERTIFICATE_BASE64: Base64 encoded certificate"
- echo " MACOS_CERTIFICATE_PASSWORD: Certificate password"
- echo " MACOS_CERTIFICATE_NAME: Certificate name for signing"
- echo " APPLE_ID: Apple ID for notarization"
- echo " APPLE_TEAM_ID: Apple Team ID for notarization"
- echo " APPLE_ID_PASSWORD: App-specific password for Apple ID"
- exit 1
-}
-
-# Function to check required environment variables
-check_env_vars() {
- local required_vars=(
- "MACOS_CERTIFICATE_BASE64"
- "MACOS_CERTIFICATE_PASSWORD"
- "MACOS_CERTIFICATE_NAME"
- "APPLE_ID"
- "APPLE_TEAM_ID"
- "APPLE_ID_PASSWORD"
- )
-
- for var in "${required_vars[@]}"; do
- if [ -z "${!var+x}" ]; then
- echo "Error: $var is not set. Please set it in your environment or .env file."
- exit 1
- fi
- done
-}
-
-# Function to ensure create-dmg is installed
-ensure_create_dmg_is_installed() {
- if ! command -v create-dmg &> /dev/null; then
- echo "create-dmg not found. Installing..."
- brew install create-dmg
- else
- echo "create-dmg is already installed."
- fi
-}
-
-# Function to create app bundle
-create_app_bundle() {
- echo "Creating app bundle..."
- local bundle_path="target/release/bundle/${ARCH}/${APP_NAME}.app"
- mkdir -p "${bundle_path}/Contents/"{MacOS,Resources}
- cp "target/${ARCH}-apple-darwin/release/node-gui" "${bundle_path}/Contents/MacOS/"
- cp "build-tools/assets/logo.icns" "${bundle_path}/Contents/Resources/"
-
- echo "Generating Info.plist..."
- local version
- version=$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "node-gui") | .version')
- if [ -z "${version+x}" ]; then
- echo "Error: Failed to retrieve version from cargo metadata"
- exit 1
- fi
- local build_number=$(date +%Y%m%d.%H%M%S)
- sed -e "s/VERSION_PLACEHOLDER/$version/g" \
- -e "s/BUILD_PLACEHOLDER/$build_number/g" \
- -e "s/MACOS_VERSION_PLACEHOLDER/10.13/g" \
- "build-tools/osx/Info.plist.template" > "${bundle_path}/Contents/Info.plist"
-}
-
-# Function to set up keychain and import certificate
-setup_keychain() {
- echo "Setting up keychain and importing certificate..."
- local certificate_path="$RUNNER_TEMP/build_certificate.p12"
- local keychain_path="$RUNNER_TEMP/$KEYCHAIN_NAME"
- local apple_cert_path="build-tools/osx/DeveloperIDG2CA.cer"
- echo "$MACOS_CERTIFICATE_BASE64" | base64 --decode > "$certificate_path"
- security create-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path"
- security set-keychain-settings -lut 21600 "$keychain_path"
- security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path"
- security import "$apple_cert_path" -k "$keychain_path" -T /usr/bin/codesign
- security import "$certificate_path" -k "$keychain_path" -P "$MACOS_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
- security list-keychains -d user -s "$keychain_path"
- security default-keychain -s "$keychain_path"
- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$keychain_path"
-}
-
-# Function to sign the app
-sign_app() {
- echo "Signing the app..."
- /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" \
- --options runtime \
- --entitlements "build-tools/osx/entitlements.plist" \
- --timestamp "target/release/bundle/${ARCH}/${APP_NAME}.app" -v
-}
-
-# Function to create and sign DMG
-create_and_sign_dmg() {
- echo "Creating DMG..."
- create-dmg \
- --volname "$APP_NAME" \
- --window-pos 200 120 \
- --window-size 600 400 \
- --icon-size 100 \
- --icon "${APP_NAME}.app" 175 120 \
- --hide-extension "${APP_NAME}.app" \
- --app-drop-link 425 120 \
- $DMG_NAME \
- "target/release/bundle/${ARCH}/"
-
- echo "Signing the DMG..."
- /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" \
- --options runtime \
- --timestamp $DMG_NAME -v
-}
-
-# Function to notarize and staple
-notarize_and_staple() {
- echo "Notarizing the DMG..."
- local notarization_output
- notarization_output=$(xcrun notarytool submit $DMG_NAME \
- --apple-id "$APPLE_ID" \
- --team-id "$APPLE_TEAM_ID" \
- --password "$APPLE_ID_PASSWORD" \
- --wait --timeout $NOTARIZATION_TIMEOUT)
-
- echo "Notarization output:"
- echo "$notarization_output"
-
- local submission_id
- submission_id=$(echo "$notarization_output" | grep "id:" | head -n 1 | awk '{print $2}')
-
- if [ -z "${submission_id+x}" ]; then
- echo "Failed to extract submission ID. Notarization may have failed."
- exit 1
- fi
-
- echo "Notarization submitted with ID: $submission_id"
-
- local start_time=$(date +%s)
- while true; do
- local status_output
- status_output=$(xcrun notarytool info "$submission_id" \
- --apple-id "$APPLE_ID" \
- --team-id "$APPLE_TEAM_ID" \
- --password "$APPLE_ID_PASSWORD")
-
- echo "Notarization status output:"
- echo "$status_output"
-
- local status
- status=$(echo "$status_output" | grep "status:" | awk '{print $2}')
-
- if [ -z "${status+x}" ]; then
- echo "Error: Failed to extract status from notarization info"
- exit 1
- fi
-
- echo "Notarization status: $status"
-
- if [ "$status" == "Accepted" ]; then
- echo "Notarization successful!"
- break
- elif [ "$status" == "Invalid" ]; then
- echo "Notarization failed!"
- exit 1
- fi
-
- local current_time=$(date +%s)
- if [ $((current_time - start_time)) -ge $NOTARIZATION_TIMEOUT ]; then
- echo "Notarization timed out after $NOTARIZATION_TIMEOUT seconds"
- exit 1
- fi
-
- sleep 10
- done
-
- echo "Stapling the notarization ticket..."
- xcrun stapler staple $DMG_NAME
-
- echo "Verifying notarization..."
- spctl -a -vv -t install $DMG_NAME
-}
-
-# Function to clean up
-cleanup() {
- echo "Cleaning up..."
- security delete-keychain "$RUNNER_TEMP/$KEYCHAIN_NAME"
- rm "$RUNNER_TEMP/build_certificate.p12"
- if [ -z "${RUNNER_TEMP_PRESERVE+x}" ]; then
- rm -rf "$RUNNER_TEMP"
- fi
-}
-
-# Main execution
-main() {
- if [ $# -ne 2 ]; then
- usage
- fi
-
- if [ "$ARCH" != "aarch64" ] && [ "$ARCH" != "x86_64" ]; then
- echo "Invalid architecture. Use aarch64 or x86_64."
- exit 1
- fi
-
- if [ -f .env ]; then
- set -a
- source .env
- set +a
- fi
-
- # Set RUNNER_TEMP to a local temporary directory if it's not already set
- if [ -z "${RUNNER_TEMP+x}" ]; then
- RUNNER_TEMP=$(mktemp -d)
- echo "RUNNER_TEMP is not set. Using temporary directory: $RUNNER_TEMP"
- fi
-
- check_env_vars
- ensure_create_dmg_is_installed
- create_app_bundle
- setup_keychain
- sign_app
- create_and_sign_dmg
- notarize_and_staple
- cleanup
-
- echo "Process completed successfully!"
-}
-
-main "$@"
\ No newline at end of file
diff --git a/build-tools/win/create-nsis-installers.ps1 b/build-tools/win/create-nsis-installers.ps1
index dd9179b8b6..cb09cb381a 100644
--- a/build-tools/win/create-nsis-installers.ps1
+++ b/build-tools/win/create-nsis-installers.ps1
@@ -1,7 +1,6 @@
-# Renders the NSIS installer scripts from the templates in .\nsi\ and builds
-# them with makensis. Produces:
+# Renders the NSIS installer script from the template in .\nsi\ and builds
+# it with makensis. Produces:
# - Mintlayer_Node_win__Setup.exe (CLI daemons and tools)
-# - Mintlayer_Node_GUI_win__Setup.exe (GUI)
#
# Requires: NSIS 3 on PATH (or in the default install location); LICENSE.txt
# (as produced by create-license.ps1) and the release binaries under
@@ -44,7 +43,7 @@ Write-Host "Using makensis at: $makensisPath"
$requiredBinaries = @(
"node-daemon.exe", "wallet-rpc-daemon.exe", "api-web-server.exe",
"api-blockchain-scanner-daemon.exe", "dns-server.exe", "wallet-cli.exe",
- "wallet-address-generator.exe", "node-gui.exe"
+ "wallet-address-generator.exe"
)
foreach ($exe in $requiredBinaries) {
$path = Join-Path "target\release" $exe
@@ -83,11 +82,9 @@ function Build-Installer {
}
Build-Installer -TemplateName "node.nsi.in" -ScriptName "installer-node.nsi"
-Build-Installer -TemplateName "gui.nsi.in" -ScriptName "installer-gui.nsi"
$nodeOut = "Mintlayer_Node_win_${Version}_Setup.exe"
-$guiOut = "Mintlayer_Node_GUI_win_${Version}_Setup.exe"
-foreach ($out in @($nodeOut, $guiOut)) {
+foreach ($out in @($nodeOut)) {
if (-not (Test-Path $out)) {
throw "installer was not produced: $out"
}
diff --git a/build-tools/win/nsi/gui.nsi.in b/build-tools/win/nsi/gui.nsi.in
deleted file mode 100644
index 9468fb5208..0000000000
--- a/build-tools/win/nsi/gui.nsi.in
+++ /dev/null
@@ -1,95 +0,0 @@
-; Mintlayer Node GUI installer.
-; Rendered from gui.nsi.in by build-tools/win/create-nsis-installers.ps1 -
-; do not use this file directly. Requires NSIS 3 (Unicode).
-Unicode true
-; 64-bit only: .onInit/un.onInit abort on 32-bit Windows and switch the
-; registry view to 64-bit, keeping HKLM\SOFTWARE writes out of the WOW6432Node
-; redirect (see MintlayerRequireX64 in common.nsh).
-RequestExecutionLevel admin
-SetCompressor /SOLID lzma
-
-!define APPNAME "Mintlayer Node GUI"
-!define COMPANYNAME "Mintlayer"
-!define VERSION "@VERSION@"
-!define UNINSTKEY "${COMPANYNAME} ${APPNAME}"
-
-Name "${APPNAME}"
-InstallDir "$PROGRAMFILES64\${COMPANYNAME}\${APPNAME}"
-OutFile "Mintlayer_Node_GUI_win_${VERSION}_Setup.exe"
-
-!addincludedir "@NSI_DIR@"
-!include "MUI2.nsh"
-!include "LogicLib.nsh"
-
-!define MUI_ABORTWARNING
-
-; License page
-!insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
-
-; Pages
-!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_DIRECTORY
-!insertmacro MUI_PAGE_INSTFILES
-!insertmacro MUI_PAGE_FINISH
-!insertmacro MUI_UNPAGE_INSTFILES
-
-; Languages
-!insertmacro MUI_LANGUAGE "English"
-
-!include "common.nsh"
-
-; Silently remove a previously installed version so upgrades do not leave
-; stale files behind.
-Function .onInit
- !insertmacro MintlayerRequireX64
- !insertmacro MintlayerRemovePreviousInstall
-FunctionEnd
-
-; The uninstaller is a separate process; give it the 64-bit registry view too.
-Function un.onInit
- !insertmacro MintlayerRequireX64
-FunctionEnd
-
-; The install is machine-wide (admin); make the shortcuts available to all
-; users ($DESKTOP/$SMPROGRAMS resolve to the common profile directories).
-Section "Install"
- SetShellVarContext all
- SetOutPath "$INSTDIR"
- File "target\release\node-gui.exe"
- File "LICENSE.txt"
-
- ; Create desktop shortcut
- CreateShortcut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\node-gui.exe"
-
- ; Create Start Menu shortcut
- CreateDirectory "$SMPROGRAMS\${COMPANYNAME}"
- CreateShortcut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\node-gui.exe"
-
- ; Create the uninstaller
- WriteUninstaller "$INSTDIR\uninstall.exe"
-SectionEnd
-
-Section -PostInstall
- !insertmacro MintlayerUninstallRegistry
-SectionEnd
-
-Section "Uninstall"
- SetShellVarContext all
-
- ; Remove files
- Delete "$INSTDIR\node-gui.exe"
- Delete "$INSTDIR\LICENSE.txt"
- Delete "$INSTDIR\uninstall.exe"
-
- ; Remove shortcuts
- Delete "$DESKTOP\${APPNAME}.lnk"
- Delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk"
- RMDir "$SMPROGRAMS\${COMPANYNAME}"
-
- ; Remove directories used
- RMDir "$INSTDIR"
-
- ; Remove uninstall registry keys
- DeleteRegKey HKLM \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINSTKEY}"
-SectionEnd
diff --git a/build-tools/win/nsi/node.nsi.in b/build-tools/win/nsi/node.nsi.in
index b719d899b2..975ac734e4 100644
--- a/build-tools/win/nsi/node.nsi.in
+++ b/build-tools/win/nsi/node.nsi.in
@@ -84,8 +84,9 @@ Function AddToPath
WriteRegExpandStr HKLM "${ENV_KEY}" "Path" "$INSTDIR"
SendMessage ${HWND_BROADCAST} ${WM_SETTINGCHANGE} 0 "STR:Environment" /TIMEOUT=5000
${Else}
- ; Search with ';' sentinels so that e.g. "...\Mintlayer Node" does not
- ; match "...\Mintlayer Node GUI". StrLoc yields an empty string (or
+ ; Search with ';' sentinels so that an exact directory name is not
+ ; confused with a longer one that shares the same prefix. StrLoc yields
+ ; an empty string (or
; "-1" on some NSIS versions) when the needle is not found.
${StrLoc} $R1 ";$R0;" ";$INSTDIR;" ">"
${If} $R1 == ""
diff --git a/build-tools/win/smoke-install.ps1 b/build-tools/win/smoke-install.ps1
index dc87cb5bdc..3e71894194 100644
--- a/build-tools/win/smoke-install.ps1
+++ b/build-tools/win/smoke-install.ps1
@@ -13,13 +13,9 @@ param (
[string]$Installer,
[Parameter(Mandatory = $true)]
- [ValidateSet("Mintlayer Node", "Mintlayer Node GUI")]
+ [ValidateSet("Mintlayer Node")]
[string]$AppName,
- [Parameter(Mandatory = $true)]
- [ValidateSet("node", "gui")]
- [string]$Kind,
-
[Parameter(Mandatory = $true)]
[string]$Version
)
@@ -36,15 +32,11 @@ if (-not [Environment]::Is64BitProcess) {
$InstallDir = Join-Path $env:ProgramFiles (Join-Path "Mintlayer" $AppName)
$UninstKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mintlayer $AppName"
-$Binaries = if ($Kind -eq "node") {
- @(
- "node-daemon", "wallet-rpc-daemon", "api-web-server",
- "api-blockchain-scanner-daemon", "dns-server", "wallet-cli",
- "wallet-address-generator"
- )
-} else {
- @("node-gui")
-}
+$Binaries = @(
+ "node-daemon", "wallet-rpc-daemon", "api-web-server",
+ "api-blockchain-scanner-daemon", "dns-server", "wallet-cli",
+ "wallet-address-generator"
+)
function Assert-PathEntry {
param ([bool]$ShouldExist)
@@ -96,11 +88,9 @@ if ($reg.DisplayVersion -ne $Version) {
}
Write-Host " ok: files + registry (DisplayVersion $Version)"
-if ($Kind -eq "node") {
- Write-Host "== machine PATH"
- Assert-PathEntry -ShouldExist $true
- Write-Host " ok: PATH contains $InstallDir"
-}
+Write-Host "== machine PATH"
+Assert-PathEntry -ShouldExist $true
+Write-Host " ok: PATH contains $InstallDir"
Write-Host "== binaries answer --help"
foreach ($bin in $Binaries) {
@@ -144,11 +134,7 @@ foreach ($bin in $Binaries) {
if (Get-ItemProperty -Path $UninstKey -ErrorAction SilentlyContinue) {
throw "uninstall registry key still present: $UninstKey"
}
-if ($Kind -eq "node") {
- Assert-PathEntry -ShouldExist $false
- Write-Host " ok: binaries, registry and PATH cleaned up"
-} else {
- Write-Host " ok: binaries and registry cleaned up"
-}
+Assert-PathEntry -ShouldExist $false
+Write-Host " ok: binaries, registry and PATH cleaned up"
Write-Host "smoke test passed for $AppName"
diff --git a/chainstate/tx-verifier/src/transaction_verifier/mod.rs b/chainstate/tx-verifier/src/transaction_verifier/mod.rs
index 9c4d858056..6a91e453ac 100644
--- a/chainstate/tx-verifier/src/transaction_verifier/mod.rs
+++ b/chainstate/tx-verifier/src/transaction_verifier/mod.rs
@@ -193,7 +193,7 @@ where
tokens_accounting: T,
orders_accounting: O,
) -> Self {
- // TODO: both "expect"s in this function may fire when exiting the node-gui app;
+ // TODO: both "expect"s in this function may fire when the node is shutting down;
// get rid of them and return a proper Result.
// See https://github.com/mintlayer/mintlayer-core/issues/1221
let best_block = storage
diff --git a/logging/src/enrichment.rs b/logging/src/enrichment.rs
index aa2f13f438..265157b1d9 100644
--- a/logging/src/enrichment.rs
+++ b/logging/src/enrichment.rs
@@ -60,12 +60,12 @@ static ROOT_SPAN: OnceLock = OnceLock::new();
/// allocation, since the span is entered once at startup.
///
/// Note that an entered span only applies to the calling thread, which is the thread running
-/// the node setup: the main thread of node-daemon, or one of the executor threads of node-gui.
-/// The subsystem crate starts subsystem tasks and runs calls into them inside the span that
-/// is current at that point, so the events of the subsystems (emitted on the tokio worker
-/// threads) carry the enrichment only when the node manager itself runs inside the span. The
-/// node manager is therefore run under [`root_span`] explicitly, which does not depend on the
-/// thread; entering the same span again on a thread where it is already entered is harmless.
+/// the node setup. The subsystem crate starts subsystem tasks and runs calls into them inside
+/// the span that is current at that point, so the events of the subsystems (emitted on the
+/// tokio worker threads) carry the enrichment only when the node manager itself runs inside
+/// the span. The node manager is therefore run under [`root_span`] explicitly, which does not
+/// depend on the thread; entering the same span again on a thread where it is already entered
+/// is harmless.
/// Only events on threads that are started outside of that instrumentation, such as a plain
/// `tokio::spawn` or a blocking task, do not carry the span.
pub fn enter_root_span(
diff --git a/node-daemon/docs/README.md b/node-daemon/docs/README.md
index ad0e9d96d7..cb20655903 100644
--- a/node-daemon/docs/README.md
+++ b/node-daemon/docs/README.md
@@ -12,13 +12,13 @@ To use the commands mentioned above, we provide simple examples on how to do it
### Logging
-The node logs to stderr and, when `--log-to-file true` is given (the default for node-gui, off for node-daemon), also to a file.
+The node logs to stderr and, when `--log-to-file true` is given (off by default), also to a file.
Every logging option can be given on the command line, set with an environment variable (`ML_NODE_` followed by the option name in upper case with underscores) or written in the `[logging]` section of the `config.toml` file in the data directory. A command line value wins over the environment variable, which wins over the config file, which wins over the default.
| Option | Config file key | Default | Meaning |
|---|---|---|---|
-| `--log-to-file ` | `log_to_file` | `false` (`true` for node-gui) | also write the logs to a file |
+| `--log-to-file ` | `log_to_file` | `false` | also write the logs to a file |
| `--log-file-path ` | `log_file_path` | `/logs/.log` | location of the log file; a relative path is resolved against the data directory |
| `--log-file-format ` | `log_file_format` | `text` | format of the log file |
| `--log-format ` | `log_format` | unset | format of the stderr output; when unset, the `ML_LOG_STYLE` env variable applies as before |
@@ -54,7 +54,7 @@ Each line is a complete json object, so the file can be consumed line by line by
2026-11-25T12:00:00.123456Z INFO node{version="1.5.0" chain="mainnet" pid=12345 role="seed"}: chainstate: Block processed
```
-The fields come from a span that the node enters on the thread running its startup and that the node manager, which runs the subsystems, is run under explicitly. In node-daemon the lines emitted during the startup carry the fields as well; in node-gui the startup runs on an executor thread, so only the lines of the node manager and its subsystems are guaranteed to carry them. Lines emitted from threads started outside the node, such as blocking tasks, do not carry the fields either way. To leave the prefix out of the stderr output, disable the target of the enrichment span with `RUST_LOG=logging::enrichment=off`; the file sink cannot be configured this way.
+The fields come from a span that the node enters on the thread running its startup and that the node manager, which runs the subsystems, is run under explicitly. The lines emitted during the startup carry the fields as well. Lines emitted from threads started outside the node, such as blocking tasks, do not carry the fields either way. To leave the prefix out of the stderr output, disable the target of the enrichment span with `RUST_LOG=logging::enrichment=off`; the file sink cannot be configured this way.
#### `config.toml` example
diff --git a/node-gui/Cargo.toml b/node-gui/Cargo.toml
deleted file mode 100644
index f478dfad3b..0000000000
--- a/node-gui/Cargo.toml
+++ /dev/null
@@ -1,63 +0,0 @@
-[package]
-name = "node-gui"
-description = "Mintlayer Node GUI"
-license.workspace = true
-version.workspace = true
-edition.workspace = true
-rust-version.workspace = true
-
-[dependencies]
-chainstate = { path = "../chainstate" }
-common = { path = "../common" }
-logging = { path = "../logging" }
-networking = { path = "../networking" }
-node-comm = { path = "../wallet/wallet-node-client", default-features = false }
-node-gui-backend = { path = "./backend", default-features = false }
-node-lib = { path = "../node-lib" }
-p2p = { path = "../p2p" }
-storage = { path = "../storage" }
-serialization = { path = "../serialization" }
-utils = { path = "../utils" }
-wallet = { path = "../wallet", default-features = false }
-wallet-cli-commands = { path = "../wallet/wallet-cli-commands", default-features = false }
-wallet-controller = { path = "../wallet/wallet-controller", default-features = false }
-wallet-types = { path = "../wallet/types", default-features = false }
-wallet-storage = { path = "../wallet/storage", default-features = false }
-
-anyhow.workspace = true
-jiff.workspace = true
-ctor.workspace = true
-futures.workspace = true
-heck.workspace = true
-iced = { workspace = true, features = ["canvas", "debug", "tokio", "lazy"] }
-iced_aw = { workspace = true }
-iced_fonts = { workspace = true, features = ["bootstrap"] }
-rfd = { workspace = true, features = ["xdg-portal", "tokio"] }
-strum.workspace = true
-thiserror.workspace = true
-tokio.workspace = true
-
-[target.'cfg(windows)'.build-dependencies]
-winres = "0.1"
-
-[features]
-tokio-console = ["utils/tokio-console"]
-trezor = [
- "node-comm/trezor",
- "node-gui-backend/trezor",
- "wallet/trezor",
- "wallet-cli-commands/trezor",
- "wallet-controller/trezor",
- "wallet-types/trezor",
- "wallet-storage/trezor",
-]
-ledger = [
- "node-comm/ledger",
- "node-gui-backend/ledger",
- "wallet/ledger",
- "wallet-cli-commands/ledger",
- "wallet-controller/ledger",
- "wallet-types/ledger",
- "wallet-storage/ledger",
-]
-default = ["trezor", "ledger"]
diff --git a/node-gui/app.manifest b/node-gui/app.manifest
deleted file mode 100644
index 8662b4b174..0000000000
--- a/node-gui/app.manifest
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
- Mintlayer Node GUI
-
-
-
-
-
-
\ No newline at end of file
diff --git a/node-gui/backend/Cargo.toml b/node-gui/backend/Cargo.toml
deleted file mode 100644
index c16ebd9d69..0000000000
--- a/node-gui/backend/Cargo.toml
+++ /dev/null
@@ -1,62 +0,0 @@
-[package]
-name = "node-gui-backend"
-description = "Mintlayer Node GUI backend"
-license.workspace = true
-version.workspace = true
-edition.workspace = true
-rust-version.workspace = true
-
-[dependencies]
-chainstate = { path = "../../chainstate" }
-common = { path = "../../common" }
-crypto = { path = "../../crypto" }
-logging = { path = "../../logging" }
-mempool = { path = "../../mempool" }
-node-comm = { path = "../../wallet/wallet-node-client", default-features = false }
-node-lib = { path = "../../node-lib" }
-p2p = { path = "../../p2p" }
-serialization = { path = "../../serialization" }
-subsystem = { path = "../../subsystem" }
-utils = { path = "../../utils" }
-wallet = { path = "../../wallet", default-features = false }
-wallet-cli-commands = { path = "../../wallet/wallet-cli-commands", default-features = false }
-wallet-controller = { path = "../../wallet/wallet-controller", default-features = false }
-wallet-rpc-client = { path = "../../wallet/wallet-rpc-client", default-features = false }
-wallet-rpc-lib = { path = "../../wallet/wallet-rpc-lib", default-features = false }
-wallet-types = { path = "../../wallet/types", default-features = false }
-
-anyhow.workspace = true
-futures.workspace = true
-itertools.workspace = true
-semver.workspace = true
-serde = { workspace = true, features = ["derive"] }
-serde_json.workspace = true
-serde_with.workspace = true
-thiserror.workspace = true
-tokio.workspace = true
-
-[dev-dependencies]
-test-utils = { path = "../../test-utils" }
-
-rstest.workspace = true
-
-[features]
-trezor = [
- "node-comm/trezor",
- "wallet/trezor",
- "wallet-cli-commands/trezor",
- "wallet-controller/trezor",
- "wallet-rpc-client/trezor",
- "wallet-rpc-lib/trezor",
- "wallet-types/trezor",
-]
-ledger = [
- "node-comm/ledger",
- "wallet/ledger",
- "wallet-cli-commands/ledger",
- "wallet-controller/ledger",
- "wallet-rpc-client/ledger",
- "wallet-rpc-lib/ledger",
- "wallet-types/ledger",
-]
-default = ["trezor", "ledger"]
diff --git a/node-gui/backend/src/account_id.rs b/node-gui/backend/src/account_id.rs
deleted file mode 100644
index e767e59747..0000000000
--- a/node-gui/backend/src/account_id.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2021-2024 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use crypto::key::hdkd::u31::U31;
-use serde::{Deserialize, Serialize, de::Error};
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
-pub struct AccountId(U31);
-
-impl AccountId {
- pub fn new(index: U31) -> Self {
- Self(index)
- }
-
- pub fn account_index(&self) -> U31 {
- self.0
- }
-}
-
-impl Serialize for AccountId {
- fn serialize(&self, serializer: S) -> Result {
- self.0.into_u32().serialize(serializer)
- }
-}
-
-impl<'de> Deserialize<'de> for AccountId {
- fn deserialize>(deserializer: D) -> Result {
- let i = u32::deserialize(deserializer)?;
- let i = U31::from_u32(i).ok_or_else(|| {
- D::Error::custom(format!("Integer has invalid value for AccountId ({i})"))
- })?;
- Ok(Self::new(i))
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- use rstest::rstest;
- use test_utils::random::{RngExt as _, Seed};
-
- #[rstest]
- #[trace]
- #[case(Seed::from_entropy())]
- fn test_json_valid(#[case] seed: Seed) {
- let mut rng = test_utils::random::make_seedable_rng(seed);
-
- let id = AccountId::new(U31::from_u32_with_msb(rng.random::()).0);
-
- let id_json = serde_json::to_string(&id).unwrap();
- let id_decoded = serde_json::from_str::(&id_json).unwrap();
- assert_eq!(id_decoded, id);
- }
-
- #[rstest]
- #[trace]
- #[case(Seed::from_entropy())]
- fn test_json_invalid(#[case] seed: Seed) {
- use crypto::key::hdkd::u31::MSB_BIT;
-
- let mut rng = test_utils::random::make_seedable_rng(seed);
-
- let str = rng.random_range(MSB_BIT..u32::MAX).to_string();
-
- serde_json::from_str::(&str).unwrap_err();
- }
-}
diff --git a/node-gui/backend/src/backend_impl.rs b/node-gui/backend/src/backend_impl.rs
deleted file mode 100644
index 7b53cf1084..0000000000
--- a/node-gui/backend/src/backend_impl.rs
+++ /dev/null
@@ -1,1721 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::{collections::BTreeMap, fmt::Debug, path::PathBuf, str::FromStr, sync::Arc};
-
-use futures::{TryStreamExt, stream::FuturesOrdered};
-use tokio::{
- sync::mpsc::{UnboundedReceiver, UnboundedSender},
- task::JoinHandle,
-};
-
-use common::{
- address::{Address, RpcAddress},
- chain::{ChainConfig, GenBlock, SignedTransaction},
- primitives::{BlockHeight, Id, per_thousand::PerThousand},
-};
-use crypto::key::hdkd::{child_number::ChildNumber, u31::U31};
-use logging::log;
-use node_comm::rpc_client::ColdWalletClient;
-use node_lib::node_controller::NodeController;
-use serialization::hex_encoded::HexEncoded;
-use utils::tokio_spawn;
-use wallet::{WalletError, account::transaction_list::TransactionList, wallet::Error};
-use wallet_cli_commands::{CommandHandler, ConsoleCommand, ManageableWalletCommand, WalletCommand};
-use wallet_controller::{
- ControllerConfig, NodeInterface, UtxoState, WalletHandlesClient, make_cold_wallet_rpc_client,
- types::{Balances, WalletCreationOptions, WalletExtraInfo, WalletTypeArgs},
-};
-use wallet_rpc_client::handles_client::WalletRpcHandlesClient;
-use wallet_rpc_lib::{EventStream, WalletRpc, WalletService, types::HardwareWalletType};
-
-/// A parsed GUI console line: a grammar view to print, nothing to do, or a
-/// command to execute.
-#[derive(Debug)]
-enum ParsedLine {
- Command(ManageableWalletCommand),
- View(String),
- Empty,
-}
-
-#[derive(Debug)]
-enum ConsoleOutcome {
- Print(ConsoleCommand),
- Execute(ManageableWalletCommand),
-}
-
-/// Parse a GUI console line against the node's grammar, answering the grammar
-/// views (`help full`, `legacy`) before parsing — the same contract the CLI
-/// REPL modes follow.
-fn parse_console_line(line: String, cold_wallet: bool) -> Result {
- // The grammar build and the parse construct large augment frames; this
- // runs on the caller's dedicated thread.
- wallet_cli_commands::run_with_large_stack(move || {
- let repl_command = wallet_cli_commands::build_repl_command(cold_wallet, false);
- if let Some(view) = wallet_cli_commands::grammar_view_request(&line, &repl_command) {
- return Ok(ParsedLine::View(view));
- }
- wallet_cli_commands::parse_input::(
- &line,
- &repl_command,
- )
- .map_err(|e| BackendError::InvalidConsoleCommand(e.to_string()))
- .map(|parsed| match parsed {
- Some(command) => ParsedLine::Command(command),
- // Comments and blank lines stay a no-op.
- None => ParsedLine::Empty,
- })
- })
-}
-
-/// Map a parsed console line to what the backend does with it: print a view,
-/// reject an empty line, or execute the command.
-fn console_outcome(parsed: ParsedLine) -> Result {
- match parsed {
- ParsedLine::View(view) => Ok(ConsoleOutcome::Print(ConsoleCommand::Print(view))),
- ParsedLine::Empty => Err(BackendError::EmptyConsoleCommand),
- ParsedLine::Command(command) => Ok(ConsoleOutcome::Execute(command)),
- }
-}
-use wallet_types::{
- ImportOrCreate, scan_blockchain::ScanBlockchain, wallet_type::WalletType,
- with_locked::WithLocked,
-};
-
-use super::{
- account_id::AccountId,
- chainstate_event_handler::ChainstateEventHandler,
- error::BackendError,
- messages::{
- AccountInfo, AddressInfo, BackendEvent, BackendRequest, CreateDelegationRequest,
- DecommissionPoolRequest, DelegateStakingRequest, EncryptionAction, EncryptionState,
- SendDelegateToAddressRequest, SendRequest, SignedTransactionWrapper, StakeRequest,
- TransactionInfo, WalletId, WalletInfo,
- },
- p2p_event_handler::P2pEventHandler,
- parse_address, parse_coin_amount,
- wallet_events::GuiWalletEvents,
-};
-
-/// This number of transactions will fit into the corresponding widget when the main window
-/// has the initial height (both when the status bar is visible and when it's not).
-const TRANSACTION_LIST_PAGE_COUNT: usize = 16;
-/// In which top N MB should we aim for our transactions to be in the mempool
-/// e.g. for 5, we aim to be in the top 5 MB of transactions based on paid fees
-/// This is to avoid getting trimmed off the lower end if the mempool runs out of memory
-const IN_TOP_X_MB: usize = 5;
-
-enum GuiHotColdController {
- Hot(
- WalletRpc,
- CommandHandler>,
- ),
- Cold(
- WalletRpc,
- CommandHandler>,
- ),
-}
-
-struct WalletData {
- controller: GuiHotColdController,
- best_block: (Id, BlockHeight),
- accounts: BTreeMap,
- updated: bool,
-}
-
-impl WalletData {
- fn hot_wallet(&mut self) -> Option<&mut WalletRpc> {
- match &mut self.controller {
- GuiHotColdController::Hot(w, _) => Some(w),
- GuiHotColdController::Cold(_, _) => None,
- }
- }
-
- async fn shutdown(mut self) {
- match &mut self.controller {
- GuiHotColdController::Hot(w, _) => {
- w.close_wallet().await.expect("should close the wallet");
- w.shutdown().expect("should close the wallet");
- }
- GuiHotColdController::Cold(w, _) => {
- w.close_wallet().await.expect("should close the wallet");
- w.shutdown().expect("should close the wallet");
- }
- }
- }
-}
-
-enum ColdHotNodeController {
- Cold,
- Hot(NodeController),
-}
-
-impl ColdHotNodeController {
- fn shutdown(self) {
- match self {
- Self::Hot(controller) => {
- controller.shutdown_trigger.initiate();
- }
- Self::Cold => {}
- }
- }
-
- fn is_cold(&self) -> bool {
- match self {
- Self::Hot(_) => false,
- Self::Cold => true,
- }
- }
-}
-
-struct AccountData {
- /// How many transactions the user has seen and scrolled (can be 0, 10, 20, etc).
- /// The variable is stored here so that the backend can send transaction list updates automatically.
- transaction_list_skip: usize,
-
- /// If set, pool balances and delegations should be updated in the UI.
- /// The flag is necessary because the pool balances load requires RPC call and may fail.
- update_pool_balance_and_delegations: bool,
-}
-
-pub struct Backend {
- chain_config: Arc,
-
- /// The bounded sender is used so that the UI is not overloaded with messages.
- /// With an unbounded sender, high latency was experienced when wallet scan was enabled.
- event_tx: UnboundedSender,
- /// Low priority event_tx for sending wallet updates when new blocks are scanned
- /// without this the queue can get filled up with updates when the wallet is far behind
- /// and user events interacting with the wallet can start lagging
- low_priority_event_tx: UnboundedSender,
-
- wallet_updated_tx: UnboundedSender,
-
- controller: ColdHotNodeController,
-
- manager_join_handle: JoinHandle<()>,
-
- wallets: BTreeMap,
-}
-
-impl Backend {
- pub fn new_hot(
- chain_config: Arc,
- event_tx: UnboundedSender,
- low_priority_event_tx: UnboundedSender,
- wallet_updated_tx: UnboundedSender,
- controller: NodeController,
- manager_join_handle: JoinHandle<()>,
- ) -> Self {
- Self {
- chain_config,
- event_tx,
- low_priority_event_tx,
- wallet_updated_tx,
- controller: ColdHotNodeController::Hot(controller),
- manager_join_handle,
- wallets: BTreeMap::new(),
- }
- }
-
- pub fn new_cold(
- chain_config: Arc,
- event_tx: UnboundedSender,
- low_priority_event_tx: UnboundedSender,
- wallet_updated_tx: UnboundedSender,
- manager_join_handle: JoinHandle<()>,
- ) -> Self {
- Self {
- controller: ColdHotNodeController::Cold,
- chain_config,
- event_tx,
- low_priority_event_tx,
- wallet_updated_tx,
- manager_join_handle,
- wallets: BTreeMap::new(),
- }
- }
-
- fn get_account_data(_account_index: U31) -> AccountData {
- AccountData {
- transaction_list_skip: 0,
- update_pool_balance_and_delegations: true,
- }
- }
-
- async fn get_account_info(
- controller: &WalletRpc,
- account_index: U31,
- ) -> Result<(AccountId, AccountInfo), BackendError>
- where
- T: NodeInterface + Clone + Send + Sync + Debug + 'static,
- {
- let name = controller
- .wallet_info()
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .account_names
- .into_iter()
- .nth(account_index.into_u32() as usize)
- .flatten();
-
- let addresses = controller
- .get_issued_addresses(account_index, false)
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .into_iter()
- .map(|info| {
- Ok((
- ChildNumber::from_str(&info.index)
- .map_err(|e| BackendError::InvalidAddressIndex(e.to_string()))?
- .get_index()
- .into_u32(),
- info.address.into_string(),
- ))
- })
- .collect::, _>>()?;
-
- let transaction_list = controller
- .get_transaction_list(account_index, 0, TRANSACTION_LIST_PAGE_COUNT)
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
-
- let balance = get_account_balance(controller, account_index).await?;
-
- Ok((
- AccountId::new(account_index),
- AccountInfo {
- name,
- addresses,
- staking_enabled: false,
- balance,
- staking_balance: Default::default(),
- delegations_balance: Default::default(),
- transaction_list,
- },
- ))
- }
-
- async fn add_create_wallet(
- &mut self,
- file_path: PathBuf,
- wallet_args: WalletTypeArgs,
- wallet_type: WalletType,
- import: ImportOrCreate,
- ) -> Result {
- let wallet_id = WalletId::new();
- let wallet_events = GuiWalletEvents::new(wallet_id, self.wallet_updated_tx.clone());
-
- let create_hot_wallet =
- async |controller: &NodeController,
- wallet_args: WalletTypeArgs,
- wallet_events: GuiWalletEvents| {
- let handles_client = WalletHandlesClient::new(
- controller.chainstate.clone(),
- controller.mempool.clone(),
- controller.block_prod.clone(),
- controller.p2p.clone(),
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
-
- let (wallet_rpc, command_handler, best_block, accounts_info, accounts_data) =
- Self::create_wallet(
- self.chain_config.clone(),
- handles_client,
- file_path.clone(),
- wallet_args,
- import,
- false,
- wallet_events,
- )
- .await?;
-
- let wallet_data = WalletData {
- controller: GuiHotColdController::Hot(wallet_rpc, command_handler),
- accounts: accounts_data,
- best_block,
- updated: false,
- };
-
- Ok((wallet_data, accounts_info, best_block))
- };
-
- let (wallet_data, accounts_info, best_block) = match (wallet_type, &self.controller) {
- (WalletType::Hot, ColdHotNodeController::Hot(controller)) => {
- create_hot_wallet(controller, wallet_args, wallet_events).await?
- }
- (WalletType::Cold, _) => {
- let client = make_cold_wallet_rpc_client(Arc::clone(&self.chain_config));
-
- let (wallet_rpc, command_handler, best_block, accounts_info, accounts_data) =
- Self::create_wallet(
- self.chain_config.clone(),
- client,
- file_path.clone(),
- wallet_args,
- import,
- self.controller.is_cold(),
- wallet_events,
- )
- .await?;
-
- let wallet_data = WalletData {
- controller: GuiHotColdController::Cold(wallet_rpc, command_handler),
- accounts: accounts_data,
- best_block,
- updated: false,
- };
-
- (wallet_data, accounts_info, best_block)
- }
- #[cfg(feature = "trezor")]
- (WalletType::Trezor, ColdHotNodeController::Hot(controller)) => {
- create_hot_wallet(controller, wallet_args, wallet_events).await?
- }
- #[cfg(feature = "ledger")]
- (WalletType::Ledger, ColdHotNodeController::Hot(controller)) => {
- create_hot_wallet(controller, wallet_args, wallet_events).await?
- }
- #[cfg(feature = "trezor")]
- (WalletType::Trezor, ColdHotNodeController::Cold) => {
- return Err(BackendError::HardwareWalletNotSupportedInColdMode);
- }
- #[cfg(feature = "ledger")]
- (WalletType::Ledger, ColdHotNodeController::Cold) => {
- return Err(BackendError::HardwareWalletNotSupportedInColdMode);
- }
- (WalletType::Hot, ColdHotNodeController::Cold) => {
- return Err(BackendError::HotNotSupported);
- }
- };
-
- let encryption = EncryptionState::Disabled;
- let wallet_extra_info = Self::get_wallet_extra_info(&wallet_data.controller).await?;
-
- let wallet_info = WalletInfo {
- wallet_id,
- path: file_path,
- encryption,
- accounts: accounts_info,
- best_block,
- wallet_type,
- extra_info: wallet_extra_info,
- };
-
- self.wallets.insert(wallet_id, wallet_data);
-
- Ok(wallet_info)
- }
-
- async fn get_wallet_extra_info(
- controller: &GuiHotColdController,
- ) -> Result {
- let wallet_info_from_rpc = match controller {
- GuiHotColdController::Hot(wallet_rpc, _) => wallet_rpc
- .wallet_info()
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?,
- GuiHotColdController::Cold(wallet_rpc, _) => wallet_rpc
- .wallet_info()
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?,
- };
-
- Ok(wallet_info_from_rpc.extra_info)
- }
-
- async fn create_wallet(
- chain_config: Arc,
- handles_client: N,
- file_path: PathBuf,
- wallet_args: WalletTypeArgs,
- import: ImportOrCreate,
- cold_wallet: bool,
- wallet_events: GuiWalletEvents,
- ) -> Result<
- (
- WalletRpc,
- CommandHandler>,
- (Id, BlockHeight),
- BTreeMap,
- BTreeMap,
- ),
- BackendError,
- >
- where
- N: NodeInterface + Clone + Debug + Send + Sync + 'static,
- {
- let wallet_service =
- WalletService::start(chain_config.clone(), None, false, vec![], handles_client)
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?;
- let wallet_handle = wallet_service.handle();
- let node_rpc = wallet_service.node_rpc().clone();
- let chain_config = wallet_service.chain_config().clone();
- let wallet_rpc = WalletRpc::new(wallet_handle, node_rpc.clone(), chain_config.clone());
-
- let options = WalletCreationOptions {
- overwrite_wallet_file: true,
- scan_blockchain: import.should_scan_blockchain(),
- };
- let created_wallet = wallet_rpc
- .create_wallet(file_path, wallet_args, options)
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?;
- match created_wallet {
- wallet_controller::types::CreatedWallet::UserProvidedMnemonic
- | wallet_controller::types::CreatedWallet::NewlyGeneratedMnemonic(_) => {}
- #[cfg(feature = "trezor")]
- wallet_controller::types::CreatedWallet::TrezorDeviceSelection(found_devices) => {
- return Err(BackendError::MultipleTrezorDevicesFound(found_devices));
- }
- }
- tokio_spawn(
- forward_events(
- wallet_events,
- wallet_service
- .handle()
- .subscribe()
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?,
- ),
- "Forward events (create_wallet)",
- );
- // The GUI console grammar is non-mutable on hot and cold wallets
- // alike; the `legacy` listing must match it.
- let command_handler = CommandHandler::new(
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- broadcast_to_mempool: true,
- },
- WalletRpcHandlesClient::new(wallet_rpc.clone(), None),
- None,
- cold_wallet,
- false,
- )
- .await;
- let best_block = wallet_rpc
- .best_block()
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
- let best_block = (best_block.id, best_block.height);
- let account_indexes = wallet_rpc.wallet_info().await.expect("").account_names.len();
- let accounts_info: FuturesOrdered<_> = (0..account_indexes)
- .map(|account_index| {
- let account_index = U31::from_u32(account_index as u32).expect("valid num");
- Self::get_account_info(&wallet_rpc, account_index)
- })
- .collect();
- let accounts_info = accounts_info.try_collect().await?;
- let accounts_data = (0..account_indexes)
- .map(|account_index| {
- let account_index = U31::from_u32(account_index as u32).expect("valid num");
- (
- AccountId::new(account_index),
- Self::get_account_data(account_index),
- )
- })
- .collect();
- Ok((
- wallet_rpc,
- command_handler,
- best_block,
- accounts_info,
- accounts_data,
- ))
- }
-
- async fn add_open_wallet(
- &mut self,
- file_path: PathBuf,
- wallet_type: WalletType,
- ) -> Result {
- let wallet_id = WalletId::new();
- let wallet_events = GuiWalletEvents::new(wallet_id, self.wallet_updated_tx.clone());
-
- let open_hot_wallet = async |controller: &NodeController, wallet_type, wallet_events| {
- let handles_client = WalletHandlesClient::new(
- controller.chainstate.clone(),
- controller.mempool.clone(),
- controller.block_prod.clone(),
- controller.p2p.clone(),
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
-
- let (
- wallet_rpc,
- command_handler,
- encryption_state,
- best_block,
- accounts_info,
- accounts_data,
- ) = Self::open_wallet(
- self.chain_config.clone(),
- handles_client,
- file_path.clone(),
- wallet_events,
- wallet_type,
- false,
- )
- .await?;
-
- let wallet_data = WalletData {
- controller: GuiHotColdController::Hot(wallet_rpc, command_handler),
- accounts: accounts_data,
- best_block,
- updated: false,
- };
-
- Ok((wallet_data, accounts_info, best_block, encryption_state))
- };
-
- let (wallet_data, accounts_info, best_block, encryption) =
- match (wallet_type, &self.controller) {
- (WalletType::Hot, ColdHotNodeController::Hot(controller)) => {
- open_hot_wallet(controller, None, wallet_events).await?
- }
- (WalletType::Cold, _) => {
- let client = make_cold_wallet_rpc_client(Arc::clone(&self.chain_config));
-
- let (
- wallet_rpc,
- command_handler,
- encryption_state,
- best_block,
- accounts_info,
- accounts_data,
- ) = Self::open_wallet(
- self.chain_config.clone(),
- client,
- file_path.clone(),
- wallet_events,
- None,
- self.controller.is_cold(),
- )
- .await?;
-
- let wallet_data = WalletData {
- controller: GuiHotColdController::Cold(wallet_rpc, command_handler),
- accounts: accounts_data,
- best_block,
- updated: false,
- };
-
- (wallet_data, accounts_info, best_block, encryption_state)
- }
- #[cfg(feature = "trezor")]
- (WalletType::Trezor, ColdHotNodeController::Hot(controller)) => {
- open_hot_wallet(
- controller,
- Some(HardwareWalletType::Trezor { device_id: None }),
- wallet_events,
- )
- .await?
- }
- #[cfg(feature = "ledger")]
- (WalletType::Ledger, ColdHotNodeController::Hot(controller)) => {
- open_hot_wallet(controller, Some(HardwareWalletType::Ledger), wallet_events)
- .await?
- }
- #[cfg(feature = "trezor")]
- (WalletType::Trezor, ColdHotNodeController::Cold) => {
- return Err(BackendError::HardwareWalletNotSupportedInColdMode);
- }
- #[cfg(feature = "ledger")]
- (WalletType::Ledger, ColdHotNodeController::Cold) => {
- return Err(BackendError::HardwareWalletNotSupportedInColdMode);
- }
- (WalletType::Hot, ColdHotNodeController::Cold) => {
- return Err(BackendError::HotNotSupported);
- }
- };
-
- let wallet_extra_info = Self::get_wallet_extra_info(&wallet_data.controller).await?;
-
- let wallet_info = WalletInfo {
- wallet_id,
- path: file_path,
- encryption,
- accounts: accounts_info,
- best_block,
- wallet_type,
- extra_info: wallet_extra_info,
- };
-
- self.wallets.insert(wallet_id, wallet_data);
-
- Ok(wallet_info)
- }
-
- async fn open_wallet(
- chain_config: Arc,
- handles_client: N,
- file_path: PathBuf,
- wallet_events: GuiWalletEvents,
- hardware_wallet: Option,
- cold_wallet: bool,
- ) -> Result<
- (
- WalletRpc,
- CommandHandler>,
- EncryptionState,
- (Id, BlockHeight),
- BTreeMap,
- BTreeMap,
- ),
- BackendError,
- >
- where
- N: NodeInterface + Clone + Debug + Send + Sync + 'static,
- {
- let wallet_service =
- WalletService::start(chain_config.clone(), None, false, vec![], handles_client)
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?;
- let wallet_handle = wallet_service.handle();
- let node_rpc = wallet_service.node_rpc().clone();
- let chain_config = wallet_service.chain_config().clone();
- let wallet_rpc = WalletRpc::new(wallet_handle, node_rpc.clone(), chain_config.clone());
- let opened_wallet = wallet_rpc
- .open_wallet(
- file_path,
- None,
- false,
- ScanBlockchain::ScanNoWait,
- hardware_wallet,
- )
- .await
- .map_err(|err| BackendError::WalletError(err.to_string()))?;
- match opened_wallet {
- | wallet_controller::types::OpenedWallet::Opened => {}
- #[cfg(feature = "trezor")]
- wallet_controller::types::OpenedWallet::TrezorDeviceSelection(found_devices) => {
- return Err(BackendError::MultipleTrezorDevicesFound(found_devices));
- }
- }
- tokio_spawn(
- forward_events(
- wallet_events,
- wallet_service
- .handle()
- .subscribe()
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?,
- ),
- "Forward events (open_wallet)",
- );
- // The GUI console grammar is non-mutable on hot and cold wallets
- // alike; the `legacy` listing must match it.
- let command_handler = CommandHandler::new(
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- broadcast_to_mempool: true,
- },
- WalletRpcHandlesClient::new(wallet_rpc.clone(), None),
- None,
- cold_wallet,
- false,
- )
- .await;
- let encryption_state = match wallet_rpc.remove_private_key_encryption().await {
- Ok(_) => EncryptionState::Disabled,
- Err(wallet_rpc_lib::RpcError::Controller(
- wallet_controller::ControllerError::WalletError(WalletError::DatabaseError(
- Error::WalletLocked,
- )),
- )) => EncryptionState::EnabledLocked,
- Err(_) => EncryptionState::Disabled,
- };
- let best_block = wallet_rpc
- .best_block()
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
- let best_block = (best_block.id, best_block.height);
- let account_indexes = wallet_rpc.wallet_info().await.expect("").account_names.len();
- let accounts_info: FuturesOrdered<_> = (0..account_indexes)
- .map(|account_index| {
- let account_index = U31::from_u32(account_index as u32).expect("valid num");
- Self::get_account_info(&wallet_rpc, account_index)
- })
- .collect();
- let accounts_info = accounts_info.try_collect().await?;
- let accounts_data = (0..account_indexes)
- .map(|account_index| {
- let account_index = U31::from_u32(account_index as u32).expect("valid num");
- (
- AccountId::new(account_index),
- Self::get_account_data(account_index),
- )
- })
- .collect();
- Ok((
- wallet_rpc,
- command_handler,
- encryption_state,
- best_block,
- accounts_info,
- accounts_data,
- ))
- }
-
- async fn update_encryption(
- &mut self,
- wallet_id: WalletId,
- action: EncryptionAction,
- ) -> Result<(WalletId, EncryptionState), BackendError> {
- let wallet = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?;
-
- match &mut wallet.controller {
- GuiHotColdController::Hot(w, _) => encrypt_action(action, w, wallet_id).await,
- GuiHotColdController::Cold(w, _) => encrypt_action(action, w, wallet_id).await,
- }
- }
-
- async fn new_account(
- &mut self,
- wallet_id: WalletId,
- name: String,
- ) -> Result<(WalletId, AccountId, AccountInfo), BackendError> {
- let wallet = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?;
-
- let name = name.trim().to_owned();
- let name = (!name.is_empty()).then_some(name);
-
- let hot_wallet = wallet.hot_wallet().ok_or(BackendError::ColdWallet)?;
- let (account_index, _name) = hot_wallet
- .create_account(name)
- .await
- .map(|info| (U31::from_u32(info.account).expect("valid index"), info.name))
- .map_err(|err| BackendError::WalletError(err.to_string()))?;
-
- let (account_id, account_info) = Self::get_account_info(hot_wallet, account_index).await?;
- let account_data = Self::get_account_data(account_index);
-
- wallet.accounts.insert(account_id, account_data);
-
- Ok((wallet_id, account_id, account_info))
- }
-
- async fn new_address(
- &mut self,
- wallet_id: WalletId,
- account_id: AccountId,
- ) -> Result {
- let wallet = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?;
-
- let (index, address) = match &mut wallet.controller {
- GuiHotColdController::Cold(w, _) => w
- .issue_address(account_id.account_index())
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))
- .map(|info| (info.index, info.address))?,
- GuiHotColdController::Hot(w, _) => w
- .issue_address(account_id.account_index())
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))
- .map(|info| (info.index, info.address))?,
- };
-
- AddressInfo::new(wallet_id, account_id, &index, address)
- }
-
- async fn toggle_staking(
- &mut self,
- wallet_id: WalletId,
- account_id: AccountId,
- enabled: bool,
- ) -> Result<(WalletId, AccountId, bool), BackendError> {
- if enabled {
- self.hot_wallet(wallet_id)?
- .start_staking(account_id.account_index())
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
- } else {
- self.hot_wallet(wallet_id)?
- .stop_staking(account_id.account_index())
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
- }
- Ok((wallet_id, account_id, enabled))
- }
-
- fn hot_wallet(
- &mut self,
- wallet_id: WalletId,
- ) -> Result<&mut WalletRpc, BackendError> {
- self.wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?
- .hot_wallet()
- .ok_or(BackendError::ColdWallet)
- }
-
- async fn send_amount(
- &mut self,
- send_request: SendRequest,
- ) -> Result {
- let SendRequest {
- wallet_id,
- account_id,
- address,
- amount,
- } = send_request;
-
- let address = parse_address(&self.chain_config, &address)
- .map_err(|err| BackendError::AddressError(err.to_string()))?;
- let amount = parse_coin_amount(&self.chain_config, &amount)
- .ok_or(BackendError::InvalidAmount(amount))?;
-
- // TODO: add support for utxo selection in the GUI
- let tx = self
- .hot_wallet(wallet_id)?
- .send_coins(
- account_id.account_index(),
- address.into(),
- amount.into(),
- vec![],
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .tx;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx),
- })
- }
-
- async fn stake_amount(
- &mut self,
- stake_request: StakeRequest,
- ) -> Result {
- let StakeRequest {
- wallet_id,
- account_id,
- pledge_amount: amount,
- mpt,
- cost_per_block,
- decommission_address,
- } = stake_request;
-
- let amount = parse_coin_amount(&self.chain_config, &amount)
- .ok_or(BackendError::InvalidPledgeAmount(amount))?;
-
- let cost_per_block = parse_coin_amount(&self.chain_config, &cost_per_block)
- .ok_or(BackendError::InvalidCostPerBlockAmount(cost_per_block))?;
-
- let mpt = PerThousand::from_decimal_str(&mpt)
- .map_err(|_| BackendError::InvalidMarginPerThousand(mpt))?;
-
- let decommission_key = parse_address(&self.chain_config, &decommission_address)
- .map_err(|err| BackendError::AddressError(err.to_string()))?
- .into_object();
-
- let decommission_address =
- RpcAddress::new(&self.chain_config, decommission_key).expect("addressable");
- let tx = self
- .hot_wallet(wallet_id)?
- .create_stake_pool(
- account_id.account_index(),
- amount.into(),
- cost_per_block.into(),
- mpt.to_string(),
- decommission_address,
- None,
- None,
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .tx;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx),
- })
- }
-
- async fn decommission_pool(
- &mut self,
- request: DecommissionPoolRequest,
- ) -> Result {
- let DecommissionPoolRequest {
- wallet_id,
- account_id,
- pool_id,
- output_address,
- } = request;
-
- let tx = self
- .hot_wallet(wallet_id)?
- .decommission_stake_pool(
- account_id.account_index(),
- pool_id.into(),
- Some(output_address.into()),
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .tx;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx),
- })
- }
-
- async fn create_delegation(
- &mut self,
- request: CreateDelegationRequest,
- ) -> Result {
- let CreateDelegationRequest {
- wallet_id,
- account_id,
- pool_id,
- delegation_address,
- } = request;
-
- let (tx, _) = self
- .hot_wallet(wallet_id)?
- .create_delegation(
- account_id.account_index(),
- delegation_address.into(),
- pool_id.into(),
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx.tx),
- })
- }
-
- async fn delegate_staking(
- &mut self,
- request: DelegateStakingRequest,
- ) -> Result {
- let DelegateStakingRequest {
- wallet_id,
- account_id,
- delegation_id,
- delegation_amount,
- } = request;
-
- let delegation_amount = parse_coin_amount(&self.chain_config, &delegation_amount)
- .ok_or(BackendError::InvalidAmount(delegation_amount))?;
-
- let tx = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?
- .hot_wallet()
- .ok_or(BackendError::ColdWallet)?
- .delegate_staking(
- account_id.account_index(),
- delegation_amount.into(),
- RpcAddress::new(&self.chain_config, delegation_id).expect("addressable"),
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .tx;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx),
- })
- }
-
- async fn send_delegation_to_address(
- &mut self,
- request: SendDelegateToAddressRequest,
- ) -> Result {
- let SendDelegateToAddressRequest {
- wallet_id,
- account_id,
- address,
- amount,
- delegation_id,
- } = request;
-
- let address = parse_address(&self.chain_config, &address)
- .map_err(|err| BackendError::AddressError(err.to_string()))?;
-
- let amount = parse_coin_amount(&self.chain_config, &amount)
- .ok_or(BackendError::InvalidAmount(amount))?;
-
- let delegation_id = Address::from_string(&self.chain_config, &delegation_id)
- .map_err(|e| BackendError::AddressError(e.to_string()))?;
-
- let tx = self
- .hot_wallet(wallet_id)?
- .withdraw_from_delegation(
- account_id.account_index(),
- address.into(),
- amount.into(),
- delegation_id.into(),
- ControllerConfig {
- in_top_x_mb: IN_TOP_X_MB,
- // don't broadcast_to_mempool before confirmation dialog
- broadcast_to_mempool: false,
- },
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?
- .tx;
-
- Ok(TransactionInfo {
- wallet_id,
- tx: SignedTransactionWrapper::new(tx),
- })
- }
-
- async fn submit_transaction(
- &mut self,
- wallet_id: WalletId,
- tx: SignedTransaction,
- ) -> Result {
- self.hot_wallet(wallet_id)?
- .submit_raw_transaction(HexEncoded::new(tx), false, Default::default())
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
-
- Ok(wallet_id)
- }
-
- async fn load_transaction_list(
- &mut self,
- wallet_id: WalletId,
- account_id: AccountId,
- skip: usize,
- ) -> Result {
- let wallet = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?;
- let account = wallet
- .accounts
- .get_mut(&account_id)
- .ok_or(BackendError::UnknownAccountIndex(wallet_id, account_id))?;
- account.transaction_list_skip = skip;
- wallet
- .hot_wallet()
- .ok_or(BackendError::ColdWallet)?
- .get_transaction_list(
- account_id.account_index(),
- skip,
- TRANSACTION_LIST_PAGE_COUNT,
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))
- }
-
- async fn process_request(&mut self, request: BackendRequest) {
- match request {
- BackendRequest::OpenWallet {
- file_path,
- wallet_type,
- } => {
- let open_res = self.add_open_wallet(file_path, wallet_type).await;
- Self::send_event(&self.event_tx, BackendEvent::OpenWallet(open_res));
- }
- BackendRequest::RecoverWallet {
- wallet_args,
- file_path,
- import,
- wallet_type,
- } => {
- let import_res =
- self.add_create_wallet(file_path, wallet_args, wallet_type, import).await;
- Self::send_event(&self.event_tx, BackendEvent::ImportWallet(import_res));
- }
- BackendRequest::CloseWallet(wallet_id) => {
- if let Some(wallet) = self.wallets.remove(&wallet_id) {
- wallet.shutdown().await;
- Self::send_event(&self.event_tx, BackendEvent::CloseWallet(wallet_id));
- }
- }
-
- BackendRequest::UpdateEncryption { wallet_id, action } => {
- let res = self.update_encryption(wallet_id, action).await;
- Self::send_event(&self.event_tx, BackendEvent::UpdateEncryption(res));
- }
-
- BackendRequest::NewAccount { wallet_id, name } => {
- let res = self.new_account(wallet_id, name).await;
- Self::send_event(&self.event_tx, BackendEvent::NewAccount(res));
- }
-
- BackendRequest::NewAddress(wallet_id, account_id) => {
- let address_res = self.new_address(wallet_id, account_id).await;
- Self::send_event(&self.event_tx, BackendEvent::NewAddress(address_res));
- }
- BackendRequest::ToggleStaking(wallet_id, account_id, enabled) => {
- let toggle_res = self.toggle_staking(wallet_id, account_id, enabled).await;
- Self::send_event(&self.event_tx, BackendEvent::ToggleStaking(toggle_res));
- }
- BackendRequest::SendAmount(send_request) => {
- let send_res = self.send_amount(send_request).await;
- Self::send_event(&self.event_tx, BackendEvent::SendAmount(send_res));
- }
- BackendRequest::StakeAmount(stake_request) => {
- let stake_res = self.stake_amount(stake_request).await;
- Self::send_event(&self.event_tx, BackendEvent::StakeAmount(stake_res));
- }
- BackendRequest::DecommissionPool(decommission_request) => {
- let stake_res = self.decommission_pool(decommission_request).await;
- Self::send_event(&self.event_tx, BackendEvent::DecommissionPool(stake_res));
- }
- BackendRequest::CreateDelegation(request) => {
- let result = self.create_delegation(request).await;
- Self::send_event(&self.event_tx, BackendEvent::CreateDelegation(result));
- }
- BackendRequest::DelegateStaking(request) => {
- let delegation_id = request.delegation_id;
- let result = self.delegate_staking(request).await.map(|tx| (tx, delegation_id));
- Self::send_event(&self.event_tx, BackendEvent::DelegateStaking(result));
- }
- BackendRequest::SendDelegationToAddress(request) => {
- let result = self.send_delegation_to_address(request).await;
- Self::send_event(
- &self.event_tx,
- BackendEvent::SendDelegationToAddress(result),
- );
- }
- BackendRequest::SubmitTx { wallet_id, tx } => {
- let result = self.submit_transaction(wallet_id, tx.take_tx()).await;
- Self::send_event(&self.event_tx, BackendEvent::Broadcast(result));
- }
- BackendRequest::TransactionList {
- wallet_id,
- account_id,
- skip,
- } => {
- let transaction_list_res =
- self.load_transaction_list(wallet_id, account_id, skip).await;
- Self::send_event(
- &self.event_tx,
- BackendEvent::TransactionList(wallet_id, account_id, transaction_list_res),
- );
- }
- BackendRequest::ConsoleCommand {
- wallet_id,
- account_id,
- command,
- } => {
- let res = self.handle_console_command(wallet_id, account_id, command).await;
- Self::send_event(
- &self.event_tx,
- BackendEvent::ConsoleResponse(wallet_id, account_id, res),
- );
- }
- BackendRequest::Shutdown => unreachable!(),
- }
- }
-
- async fn handle_console_command(
- &mut self,
- wallet_id: WalletId,
- account_id: AccountId,
- command: String,
- ) -> Result {
- let cold_wallet = self.controller.is_cold();
- // The grammar build and the input parse both construct large augment
- // frames; run them on a sized thread without blocking the backend loop.
- let parsed = tokio::task::spawn_blocking(move || parse_console_line(command, cold_wallet))
- .await
- .map_err(|e| {
- if e.is_panic() {
- // An internal panic from the grammar build or parse thread is
- // not a user input problem; resume unwinding so it is reported
- // as such instead of as an invalid console command. (With the
- // workspace default of panic = "abort" this arm is mostly
- // relevant for unwind builds and tests.)
- std::panic::resume_unwind(e.into_panic());
- }
- // Cancellation (runtime shutdown) is not a user input problem either.
- log::warn!("Console command parse task did not complete: {e}");
- BackendError::ConsoleCommandInterrupted(e.to_string())
- })?;
- let parsed = parsed?;
-
- let command = match console_outcome(parsed)? {
- // A view line is the answer; print it and skip execution.
- ConsoleOutcome::Print(view) => return Ok(view),
- ConsoleOutcome::Execute(command) => command,
- };
-
- let wallet = self
- .wallets
- .get_mut(&wallet_id)
- .ok_or(BackendError::UnknownWalletIndex(wallet_id))?;
-
- match &mut wallet.controller {
- GuiHotColdController::Hot(_, c) => {
- select_acc_and_execute_cmd(c, account_id, command, &self.chain_config).await
- }
- GuiHotColdController::Cold(_, c) => {
- select_acc_and_execute_cmd(c, account_id, command, &self.chain_config).await
- }
- }
- }
-
- pub fn send_event(event_tx: &UnboundedSender, event: BackendEvent) {
- // The unbounded channel is used to avoid blocking the backend event loop.
- // Iced has a problem when it stops processing messages when the display is turned off.
- // It has been reproduced on Linux, and here is a bug reported on Windows: https://github.com/iced-rs/iced/issues/1870.
- // As a result, using the bounded channel can break staking, because once the channel is full, the backend event loop is paused.
- _ = event_tx.send(event);
- }
-
- async fn shutdown(self) {
- self.controller.shutdown();
- self.manager_join_handle.await.expect("Shutdown failed");
- }
-
- async fn update_wallets(&mut self) {
- for (wallet_id, wallet_data) in
- self.wallets.iter_mut().filter(|(_, wallet_data)| wallet_data.updated)
- {
- let controller = match &mut wallet_data.controller {
- GuiHotColdController::Cold(_, _) => continue,
- GuiHotColdController::Hot(w, _) => w,
- };
-
- wallet_data.updated = false;
-
- let best_block = controller.best_block().await.expect("shouldn't fail normally");
- let best_block = (best_block.id, best_block.height);
-
- if wallet_data.best_block != best_block {
- Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::WalletBestBlock(*wallet_id, best_block),
- );
- wallet_data.best_block = best_block;
- }
-
- for (account_id, account_data) in wallet_data.accounts.iter_mut() {
- // GuiWalletEvents will notify about wallet balance update
- // (when a wallet transaction is added/updated/removed)
- match get_account_balance(controller, account_id.account_index()).await {
- Ok(balance) => Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::Balance(*wallet_id, *account_id, balance),
- ),
- Err(err) => {
- log::error!("Address usage loading failed: {err}");
- }
- };
-
- match controller.get_issued_addresses(account_id.account_index(), false).await {
- Ok(addresses) => {
- for info in addresses {
- Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::NewAddress(AddressInfo::new(
- *wallet_id,
- *account_id,
- &info.index,
- info.address.into_string(),
- )),
- );
- }
- }
- Err(err) => {
- log::error!("Address usage loading failed: {err}");
- }
- }
-
- // GuiWalletEvents will notify about stake pool balance update
- // (when a new wallet block is added/removed from the DB)
- account_data.update_pool_balance_and_delegations = true;
-
- // GuiWalletEvents will notify about transaction list
- // (when a wallet transaction is added/updated/removed)
- let transaction_list_res = controller
- .get_transaction_list(
- account_id.account_index(),
- account_data.transaction_list_skip,
- TRANSACTION_LIST_PAGE_COUNT,
- )
- .await;
- match transaction_list_res {
- Ok(transaction_list) => {
- Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::TransactionList(
- *wallet_id,
- *account_id,
- Ok(transaction_list),
- ),
- );
- }
- Err(err) => {
- log::error!("Transaction list loading failed: {err}");
- }
- }
- }
- }
-
- // `get_stake_pool_balances` may fail if we ever start using remote RPC
- for (wallet_id, wallet_data) in self.wallets.iter_mut() {
- let controller = match &mut wallet_data.controller {
- GuiHotColdController::Hot(w, _) => w,
- GuiHotColdController::Cold(_, _) => continue,
- };
- for (account_id, account_data) in
- wallet_data.accounts.iter_mut().filter(|(_account_id, account_data)| {
- account_data.update_pool_balance_and_delegations
- })
- {
- let pool_info_res = controller.list_staking_pools(account_id.account_index()).await;
- match pool_info_res {
- Ok(staking_balance) => {
- Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::StakingBalance(
- *wallet_id,
- *account_id,
- BTreeMap::from_iter(staking_balance.into_iter().map(|info| {
- (
- info.pool_id
- .decode_object(&self.chain_config)
- .expect("valid addressable"),
- info,
- )
- })),
- ),
- );
- account_data.update_pool_balance_and_delegations = false;
- }
- Err(err) => {
- log::error!("Staking balance loading failed: {err}");
- }
- }
-
- let delegations_res =
- controller.list_delegation_ids(account_id.account_index()).await;
- match delegations_res {
- Ok(delegations_balance) => {
- Self::send_event(
- &self.low_priority_event_tx,
- BackendEvent::DelegationsBalance(
- *wallet_id,
- *account_id,
- BTreeMap::from_iter(delegations_balance.into_iter().map(|info| {
- (
- info.delegation_id
- .decode_object(&self.chain_config)
- .expect("valid addressable"),
- (
- info.pool_id
- .decode_object(&self.chain_config)
- .expect("valid addressable"),
- info.balance.amount(),
- ),
- )
- })),
- ),
- );
- account_data.update_pool_balance_and_delegations = false;
- }
- Err(err) => {
- log::error!("Delegations loading failed: {err}");
- }
- }
- }
- }
- }
-
- fn wallet_updated(&mut self, wallet_id: WalletId) {
- if let Some(wallet) = self.wallets.get_mut(&wallet_id) {
- wallet.updated = true;
- }
- }
-}
-
-async fn get_account_balance(
- controller: &WalletRpc,
- account_index: U31,
-) -> Result
-where
- N: NodeInterface + Clone + Send + Sync + 'static,
-{
- controller
- .get_balance(
- account_index,
- UtxoState::Confirmed.into(),
- WithLocked::Unlocked,
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))
-}
-
-async fn encrypt_action(
- action: EncryptionAction,
- controller: &mut WalletRpc,
- wallet_id: WalletId,
-) -> Result<(WalletId, EncryptionState), BackendError>
-where
- T: NodeInterface + Clone + Send + Sync + 'static,
-{
- match action {
- EncryptionAction::SetPassword(password) => controller
- .encrypt_private_keys(password)
- .await
- .map(|()| (wallet_id, EncryptionState::EnabledUnlocked)),
- EncryptionAction::RemovePassword => controller
- .remove_private_key_encryption()
- .await
- .map(|()| (wallet_id, EncryptionState::Disabled)),
- EncryptionAction::Unlock(password) => controller
- .unlock_private_keys(password)
- .await
- .map(|()| (wallet_id, EncryptionState::EnabledUnlocked)),
- EncryptionAction::Lock => controller
- .lock_private_keys()
- .await
- .map(|()| (wallet_id, EncryptionState::EnabledLocked)),
- }
- .map_err(|err| BackendError::WalletError(err.to_string()))
-}
-
-async fn select_acc_and_execute_cmd(
- c: &mut CommandHandler>,
- account_id: AccountId,
- command: ManageableWalletCommand,
- chain_config: &ChainConfig,
-) -> Result
-where
- N: NodeInterface + Clone + Send + Sync + 'static + Debug,
-{
- c.handle_manageable_wallet_command(
- chain_config,
- ManageableWalletCommand::WalletCommands(WalletCommand::SelectAccount {
- account_index: account_id.account_index(),
- }),
- )
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))?;
- c.handle_manageable_wallet_command(chain_config, command)
- .await
- .map_err(|e| BackendError::WalletError(e.to_string()))
-}
-
-pub async fn run(
- mut backend: Backend,
- mut request_rx: UnboundedReceiver,
- mut wallet_updated_rx: UnboundedReceiver,
- mut chainstate_event_handler: ChainstateEventHandler,
- mut p2p_event_handler: P2pEventHandler,
-) {
- loop {
- tokio::select! {
- // Make event loop more efficient
- biased;
-
- request_opt = request_rx.recv() => {
- let request = request_opt.expect("UI channel closed unexpectedly");
- if matches!(request, BackendRequest::Shutdown) {
- backend.shutdown().await;
- return;
- } else {
- backend.process_request(request).await;
- }
- }
-
- // Start this before starting the remaining background tasks
- // to reduce the chance of tasks being canceled (for efficiency)
- wallet_id = wallet_updated_rx.recv() => {
- let wallet_id = wallet_id.expect("wallet_updated_rx must be always open");
- backend.wallet_updated(wallet_id);
- }
-
- () = chainstate_event_handler.run() => {
- log::debug!("Chainstate channel closed, looks like the node has stopped");
- return
- }
-
- () = p2p_event_handler.run() => {
- log::debug!("P2P channel closed, looks like the node has stopped");
- return
- }
- }
-
- // Process all pending messages so that `update_wallets` is not needlessly called multiple times
- while let Ok(wallet_id) = wallet_updated_rx.try_recv() {
- backend.wallet_updated(wallet_id);
- }
-
- // Update UI on every loop iteration (can be after a UI request or after `wallet_notify` is triggered)
- backend.update_wallets().await;
- }
-}
-
-pub async fn run_cold(
- mut backend: Backend,
- mut request_rx: UnboundedReceiver,
- mut wallet_updated_rx: UnboundedReceiver,
-) {
- loop {
- tokio::select! {
- // Make event loop more efficient
- biased;
-
- request_opt = request_rx.recv() => {
- let request = request_opt.expect("UI channel closed unexpectedly");
- if matches!(request, BackendRequest::Shutdown) {
- backend.shutdown().await;
- return;
- } else {
- backend.process_request(request).await;
- }
- }
-
- // Start this before starting the remaining background tasks
- // to reduce the chance of tasks being canceled (for efficiency)
- wallet_id = wallet_updated_rx.recv() => {
- let wallet_id = wallet_id.expect("wallet_updated_rx must be always open");
- backend.wallet_updated(wallet_id);
- }
- }
- }
-}
-
-async fn forward_events(tx: GuiWalletEvents, mut rx: EventStream) {
- while rx.recv().await.is_some() {
- tx.notify()
- }
-}
-
-#[cfg(test)]
-mod console_view_tests {
- use super::*;
-
- // Grammar construction overflows the default 2 MiB test-thread stack, so
- // parse on a large-stack thread like the wallet CLI tests do.
- fn parse_execute_line(line: &str) -> ManageableWalletCommand {
- let line = line.to_owned();
- wallet_cli_commands::run_with_large_stack(move || {
- let repl_command = wallet_cli_commands::build_repl_command(false, false);
- wallet_cli_commands::parse_input::(
- &line,
- &repl_command,
- )
- .expect("console line must parse")
- .expect("console line must parse to a command")
- })
- }
-
- #[test]
- fn view_lines_print_and_skip_execution() {
- let outcome = console_outcome(ParsedLine::View("listing".to_owned()))
- .expect("a view line must not fail");
- match outcome {
- ConsoleOutcome::Print(ConsoleCommand::Print(text)) => assert_eq!(text, "listing"),
- other => panic!("a view line must map to a print, got {other:?}"),
- }
- }
-
- #[test]
- fn empty_lines_are_rejected() {
- assert!(matches!(
- console_outcome(ParsedLine::Empty),
- Err(BackendError::EmptyConsoleCommand)
- ));
- }
-
- #[test]
- fn commands_pass_through_to_execution() {
- let command = parse_execute_line("wallet-info");
- assert!(matches!(
- console_outcome(ParsedLine::Command(command)),
- Ok(ConsoleOutcome::Execute(_))
- ));
- }
-
- #[test]
- fn console_lines_answer_views_before_parsing() {
- // The hot GUI grammar (cold=false, non-mutable) is the variant the
- // console parses with on a hot node; the views must answer there too.
- for line in ["help full", "legacy", "help", "help wallet"] {
- match parse_console_line(line.to_owned(), false) {
- Ok(ParsedLine::View(view)) => assert!(!view.is_empty()),
- other => panic!("`{line}` must answer as a view, got {other:?}"),
- }
- }
- // Regular commands still parse to execution...
- assert!(matches!(
- parse_console_line("wallet-info".to_owned(), false),
- Ok(ParsedLine::Command(_))
- ));
- // ...and empty lines stay no-ops.
- assert!(matches!(
- parse_console_line("# comment".to_owned(), false),
- Ok(ParsedLine::Empty)
- ));
- }
-
- #[test]
- fn cold_console_pairs_the_cold_grammar_with_its_views() {
- // The cold GUI console (cold=true, non-mutable) answers the views and
- // parses the cold flat spelling that is primary in that grammar.
- match parse_console_line("help full".to_owned(), true) {
- Ok(ParsedLine::View(view)) => {
- assert!(view.contains("challenge sign"), "cold full listing\n{view}")
- }
- other => panic!("`help full` must answer as a view on cold, got {other:?}"),
- }
- assert!(matches!(
- parse_console_line("wallet-info".to_owned(), true),
- Ok(ParsedLine::Command(_))
- ));
- }
-}
diff --git a/node-gui/backend/src/chainstate_event_handler.rs b/node-gui/backend/src/chainstate_event_handler.rs
deleted file mode 100644
index 9574008c65..0000000000
--- a/node-gui/backend/src/chainstate_event_handler.rs
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::sync::Arc;
-
-use anyhow::Context as _;
-use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
-
-use chainstate::ChainstateEvent;
-use utils::tap_log::TapLog;
-
-use super::{backend_impl::Backend, messages::BackendEvent};
-
-pub struct ChainstateEventHandler {
- chainstate: chainstate::ChainstateHandle,
- chainstate_event_rx: UnboundedReceiver,
- event_tx: UnboundedSender,
- chain_info_updated: bool,
-}
-
-impl ChainstateEventHandler {
- pub async fn new(
- chainstate: chainstate::ChainstateHandle,
- event_tx: UnboundedSender,
- ) -> anyhow::Result {
- let (chainstate_event_tx, chainstate_event_rx) = unbounded_channel();
- chainstate
- .call_mut(|this| {
- this.subscribe_to_subsystem_events(Arc::new(
- move |chainstate_event: ChainstateEvent| {
- _ = chainstate_event_tx
- .send(chainstate_event)
- .log_err_pfx("Chainstate subscriber failed to send new tip");
- },
- ));
- })
- .await
- .context("Error subscribing to chainstate events")?;
-
- Ok(Self {
- chainstate,
- chainstate_event_rx,
- event_tx,
- chain_info_updated: false,
- })
- }
-
- pub async fn run(&mut self) {
- // Must be cancel-safe!
- loop {
- // The `chain_info_updated` field is needed because `run` must be cancel-safe.
- // The `run` call can be canceled between `await` points, but we need to update the UI after receiving `NewTip` event.
- if self.chain_info_updated {
- let chain_info = self
- .chainstate
- .call(|this| this.info().expect("Chainstate::info should not fail"))
- .await
- .expect("Chainstate::info should not fail");
- Backend::send_event(&self.event_tx, BackendEvent::ChainInfo(chain_info));
- self.chain_info_updated = false;
- }
-
- let chainstate_event_opt = self.chainstate_event_rx.recv().await;
- match chainstate_event_opt {
- Some(event) => match event {
- ChainstateEvent::NewTip { .. } => {
- self.chain_info_updated = true;
- }
- },
- None => {
- // Node is stopped
- return;
- }
- }
- }
- }
-}
diff --git a/node-gui/backend/src/error.rs b/node-gui/backend/src/error.rs
deleted file mode 100644
index 0bdacdad89..0000000000
--- a/node-gui/backend/src/error.rs
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#[cfg(feature = "trezor")]
-use wallet::signer::trezor_signer;
-
-use super::{account_id::AccountId, messages::WalletId};
-
-#[derive(thiserror::Error, Debug, Clone)]
-pub enum BackendError {
- #[error("Wallet error: {0}")]
- WalletError(String),
- #[error("Conversion to dehexified json error: {0}")]
- ConversionToDehexifiedJsonError(String),
- #[error("Unknown wallet index: {0:?}")]
- UnknownWalletIndex(WalletId),
- #[error("Unknown account index: {0:?}/{0:?}")]
- UnknownAccountIndex(WalletId, AccountId),
- #[error("Invalid address: {0}")]
- AddressError(String),
- #[error("Invalid address index: {0}")]
- InvalidAddressIndex(String),
- #[error("Invalid amount: {0}")]
- InvalidAmount(String),
- #[error("Invalid pledge amount: {0}")]
- InvalidPledgeAmount(String),
- #[error("Invalid cost per block amount: {0}")]
- InvalidCostPerBlockAmount(String),
- #[error(
- "Failed to parse margin per thousand: {0}. The decimal must be in the range [0.001,1.000] or [0.1%,100%]"
- )]
- InvalidMarginPerThousand(String),
- #[error("Unsupported operation by a cold wallet")]
- ColdWallet,
- #[error("Cannot interact with a Hot wallet when in Cold wallet mode")]
- HotNotSupported,
- #[error("Cannot use a hardware wallet when in Cold wallet mode")]
- HardwareWalletNotSupportedInColdMode,
- #[error("Invalid console command: {0}")]
- InvalidConsoleCommand(String),
- #[error("Console command did not complete: {0}")]
- ConsoleCommandInterrupted(String),
- #[error("Empty console command")]
- EmptyConsoleCommand,
-
- #[cfg(feature = "trezor")]
- #[error(
- "Multiple Trezor devices found: {}.\nLeave only one of them connected and try again.",
- format_multiple_trezor_devices_err(_0)
- )]
- MultipleTrezorDevicesFound(Vec),
-}
-
-#[cfg(feature = "trezor")]
-fn format_multiple_trezor_devices_err(devices: &[trezor_signer::FoundDevice]) -> String {
- use itertools::Itertools as _;
-
- devices
- .iter()
- .map(|device| format!("{} (device id = {})", device.device_name, device.device_id))
- .join(", ")
-}
diff --git a/node-gui/backend/src/lib.rs b/node-gui/backend/src/lib.rs
deleted file mode 100644
index 6d99c60b17..0000000000
--- a/node-gui/backend/src/lib.rs
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-pub mod error;
-pub mod messages;
-
-mod account_id;
-mod backend_impl;
-mod chainstate_event_handler;
-mod p2p_event_handler;
-mod wallet_events;
-
-use std::{fmt::Debug, sync::Arc};
-
-use anyhow::anyhow;
-use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
-
-use chainstate::ChainInfo;
-use common::{
- address::{Address, AddressError},
- chain::{ChainConfig, Destination},
- primitives::{Amount, BlockHeight},
-};
-use logging::log;
-use node_lib::OptionsWithResolvedCommand;
-use utils::tokio_spawn;
-
-use crate::{chainstate_event_handler::ChainstateEventHandler, p2p_event_handler::P2pEventHandler};
-
-use self::{
- error::BackendError,
- messages::{BackendEvent, BackendRequest},
-};
-
-pub use account_id::AccountId;
-
-#[derive(Debug, Clone, Copy)]
-pub enum InitNetwork {
- Mainnet,
- Testnet,
- Regtest,
-}
-
-#[derive(Debug, Clone, Copy)]
-pub enum WalletMode {
- Cold,
- Hot,
-}
-
-#[derive(Debug)]
-pub struct BackendControls {
- pub initialized_node: InitializedNode,
- pub backend_sender: BackendSender,
- pub backend_receiver: UnboundedReceiver,
- pub low_priority_backend_receiver: UnboundedReceiver,
-}
-
-/// `UnboundedSender` wrapper, used to make sure there is only one instance and it doesn't get cloned
-#[derive(Debug)]
-pub struct BackendSender {
- request_tx: UnboundedSender,
-}
-
-impl BackendSender {
- fn new(request_tx: UnboundedSender) -> Self {
- Self { request_tx }
- }
-
- pub fn send(&self, msg: BackendRequest) {
- let _ = self.request_tx.send(msg);
- }
-}
-
-fn parse_coin_amount(chain_config: &ChainConfig, value: &str) -> Option {
- Amount::from_fixedpoint_str(value, chain_config.coin_decimals())
-}
-
-fn parse_address(
- chain_config: &ChainConfig,
- address: &str,
-) -> Result, AddressError> {
- Address::from_string(chain_config, address)
-}
-
-#[derive(Debug)]
-pub struct InitializedNode {
- pub chain_config: Arc,
- pub chain_info: ChainInfo,
-}
-
-#[derive(Debug)]
-pub enum NodeInitializationOutcome {
- BackendControls(BackendControls),
- DataDirCleanedUp,
-}
-
-// Note: wgpu_hal=error is included to prevent it from spamming warnings "Unrecognized present
-// mode 1000361000" on Windows (which are emitted e.g. when resizing the window).
-// Note that this seems to have been fixed in https://github.com/gfx-rs/wgpu/pull/7850 and the fix
-// has already been released, however our dependencies still use a pretty old version of wgpu.
-const DEFAULT_LOG_FILTER: &str =
- "info,wgpu_core=error,wgpu_hal=error,hyper=error,jsonrpsee-server=error";
-
-pub async fn node_initialize(
- opts: node_lib::OptionsWithResolvedCommand,
- mode: WalletMode,
-) -> anyhow::Result {
- let opts = {
- let mut opts = opts;
- let run_opts = opts.command.run_options_mut();
-
- // For the GUI, we configure different defaults, such as disabling RPC server binding.
- // Logging to a file is enabled by default as well; that default is passed to `setup`
- // below, which applies it below the command line and the config file.
- run_opts.rpc_enabled = Some(run_opts.rpc_enabled.unwrap_or(false));
-
- opts
- };
-
- let (request_tx, request_rx) = unbounded_channel();
- let (event_tx, event_rx) = unbounded_channel();
- let (low_priority_event_tx, low_priority_event_rx) = unbounded_channel();
- let (wallet_updated_tx, wallet_updated_rx) = unbounded_channel();
-
- let (chain_config, chain_info) = match mode {
- WalletMode::Hot => {
- let setup_result = node_lib::setup(opts, DEFAULT_LOG_FILTER, true).await?;
- let node = match setup_result {
- node_lib::NodeSetupResult::RunNode(node) => node,
- node_lib::NodeSetupResult::Bootstrap(_, _) => {
- return Err(anyhow!(
- "Bootstrapping is not supported by node-gui, use node-daemon instead"
- ));
- }
- node_lib::NodeSetupResult::DataDirCleanedUp => {
- return Ok(NodeInitializationOutcome::DataDirCleanedUp);
- }
- };
-
- let controller = node.controller().clone();
-
- let manager_join_handle =
- tokio_spawn(async move { node.main().await }, "Node subsystem mgr");
-
- // Subscribe to chainstate before getting the current chain_info!
- let chainstate_event_handler =
- ChainstateEventHandler::new(controller.chainstate.clone(), event_tx.clone())
- .await?;
-
- let p2p_event_handler = P2pEventHandler::new(&controller.p2p, event_tx.clone()).await?;
-
- let chain_config =
- controller.chainstate.call(|this| Arc::clone(this.get_chain_config())).await?;
- let chain_info = controller.chainstate.call(|this| this.info()).await??;
-
- let backend = backend_impl::Backend::new_hot(
- chain_config.clone(),
- event_tx,
- low_priority_event_tx,
- wallet_updated_tx,
- controller,
- manager_join_handle,
- );
-
- tokio_spawn(
- async move {
- backend_impl::run(
- backend,
- request_rx,
- wallet_updated_rx,
- chainstate_event_handler,
- p2p_event_handler,
- )
- .await;
- },
- "NodeGUI backend",
- );
- (chain_config, chain_info)
- }
- WalletMode::Cold => spawn_cold_backend(
- opts,
- event_tx,
- request_rx,
- low_priority_event_tx,
- wallet_updated_tx,
- wallet_updated_rx,
- )?,
- };
-
- let initialized_node = InitializedNode {
- chain_config: Arc::clone(&chain_config),
- chain_info,
- };
-
- let backend_controls = BackendControls {
- initialized_node,
- backend_sender: BackendSender::new(request_tx),
- backend_receiver: event_rx,
- low_priority_backend_receiver: low_priority_event_rx,
- };
-
- Ok(NodeInitializationOutcome::BackendControls(backend_controls))
-}
-
-fn spawn_cold_backend(
- options: OptionsWithResolvedCommand,
- event_tx: UnboundedSender,
- request_rx: UnboundedReceiver,
- low_priority_event_tx: UnboundedSender,
- wallet_updated_tx: UnboundedSender,
- wallet_updated_rx: UnboundedReceiver,
-) -> anyhow::Result<(Arc, ChainInfo)> {
- logging::init_logging_with_default_filter(DEFAULT_LOG_FILTER.to_owned());
-
- let chain_config = Arc::new(handle_options_in_cold_wallet_mode(options)?);
- let chain_info = ChainInfo {
- best_block_id: chain_config.genesis_block_id(),
- best_block_height: BlockHeight::zero(),
- median_time: chain_config.genesis_block().timestamp(),
- best_block_timestamp: chain_config.genesis_block().timestamp(),
- is_initial_block_download: false,
- };
-
- let manager_join_handle = tokio_spawn(async move {}, "Fake node subsystem mgr");
-
- let backend = backend_impl::Backend::new_cold(
- chain_config.clone(),
- event_tx,
- low_priority_event_tx,
- wallet_updated_tx,
- manager_join_handle,
- );
-
- tokio_spawn(
- async move {
- backend_impl::run_cold(backend, request_rx, wallet_updated_rx).await;
- },
- "NodeGUI cold backend",
- );
-
- Ok((chain_config, chain_info))
-}
-
-fn handle_options_in_cold_wallet_mode(
- options: OptionsWithResolvedCommand,
-) -> anyhow::Result {
- if options.clean_data_option_set() {
- // Note: actually at this moment we can't get here, because the "clean data" option
- // is checked before the cold mode can be chosen.
- log::warn!("Ignoring clean-data option in cold wallet mode");
- }
-
- if options.log_to_file_option_set() {
- log::warn!("Log-to-file disabled in cold wallet mode");
- }
-
- // TODO: check all other options?
-
- options.command.create_chain_config()
-}
diff --git a/node-gui/backend/src/messages.rs b/node-gui/backend/src/messages.rs
deleted file mode 100644
index 66f8546d0c..0000000000
--- a/node-gui/backend/src/messages.rs
+++ /dev/null
@@ -1,298 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::{
- collections::BTreeMap,
- path::PathBuf,
- str::FromStr,
- sync::atomic::{AtomicU64, Ordering},
-};
-
-use serde::{Deserialize, Serialize};
-
-use chainstate::ChainInfo;
-use common::{
- chain::{ChainConfig, DelegationId, GenBlock, PoolId, SignedTransaction},
- primitives::{Amount, BlockHeight, Id},
- text_summary::TextSummary,
-};
-use crypto::key::hdkd::child_number::ChildNumber;
-use p2p::P2pEvent;
-use serialization::hex_encoded::hex_encoded_serialization;
-use wallet::account::transaction_list::TransactionList;
-use wallet_cli_commands::ConsoleCommand;
-use wallet_controller::types::{Balances, WalletExtraInfo, WalletTypeArgs};
-use wallet_rpc_lib::types::PoolInfo;
-use wallet_types::{ImportOrCreate, wallet_type::WalletType};
-
-use super::{AccountId, BackendError};
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
-pub struct WalletId(u64);
-
-static NEXT_WALLET_ID: AtomicU64 = AtomicU64::new(0);
-
-impl Default for WalletId {
- fn default() -> Self {
- Self::new()
- }
-}
-
-impl WalletId {
- pub fn new() -> Self {
- Self(NEXT_WALLET_ID.fetch_add(1, Ordering::Relaxed))
- }
-}
-
-#[derive(Debug, Clone, Serialize)]
-pub struct WalletInfo {
- pub wallet_id: WalletId,
- pub path: PathBuf,
- pub encryption: EncryptionState,
- pub accounts: BTreeMap,
- pub best_block: (Id, BlockHeight),
- pub wallet_type: WalletType,
- pub extra_info: WalletExtraInfo,
-}
-
-#[derive(Debug, Clone, Serialize)]
-pub struct AccountInfo {
- pub name: Option,
- pub addresses: BTreeMap,
- pub staking_enabled: bool,
- pub balance: Balances,
- pub staking_balance: BTreeMap,
- pub delegations_balance: BTreeMap,
- pub transaction_list: TransactionList,
-}
-
-#[derive(Debug, Clone, Serialize)]
-pub struct AddressInfo {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub index: u32,
- pub address: String,
-}
-
-impl AddressInfo {
- pub fn new(
- wallet_id: WalletId,
- account_id: AccountId,
- index: &str,
- address: String,
- ) -> Result {
- let index = ChildNumber::from_str(index)
- .map_err(|e| BackendError::InvalidAddressIndex(e.to_string()))?
- .get_index()
- .into_u32();
- Ok(AddressInfo {
- wallet_id,
- account_id,
- index,
- address,
- })
- }
-}
-
-#[derive(Debug, Clone)]
-pub struct SendRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub address: String,
- pub amount: String,
-}
-
-#[derive(Debug, Clone)]
-pub struct StakeRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub pledge_amount: String,
- pub mpt: String,
- pub cost_per_block: String,
- pub decommission_address: String,
-}
-
-#[derive(Debug, Clone)]
-pub struct DecommissionPoolRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub pool_id: String,
- pub output_address: String,
-}
-
-#[derive(Debug, Clone)]
-pub struct CreateDelegationRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub pool_id: String,
- pub delegation_address: String,
-}
-
-#[derive(Debug, Clone)]
-pub struct DelegateStakingRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub delegation_id: DelegationId,
- pub delegation_amount: String,
-}
-
-#[derive(Debug, Clone)]
-pub struct SendDelegateToAddressRequest {
- pub wallet_id: WalletId,
- pub account_id: AccountId,
- pub address: String,
- pub amount: String,
- pub delegation_id: String,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub struct SignedTransactionWrapper {
- #[serde(with = "hex_encoded_serialization")]
- tx: SignedTransaction,
-}
-
-impl SignedTransactionWrapper {
- pub fn new(tx: SignedTransaction) -> Self {
- Self { tx }
- }
-
- pub fn take_tx(self) -> SignedTransaction {
- self.tx
- }
-
- pub fn text_summary(&self, config: &ChainConfig) -> String {
- self.tx.transaction().text_summary(config)
- }
-
- pub fn to_json(&self, config: &ChainConfig) -> Result {
- common::address::dehexify::to_dehexified_json(config, self.tx.transaction())
- .map_err(|e| BackendError::ConversionToDehexifiedJsonError(e.to_string()))
- }
-}
-
-#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
-pub struct TransactionInfo {
- pub wallet_id: WalletId,
- pub tx: SignedTransactionWrapper,
-}
-
-#[derive(Debug)]
-pub enum EncryptionAction {
- SetPassword(String),
- RemovePassword,
- Unlock(String),
- Lock,
-}
-
-#[derive(Debug, Clone, Serialize)]
-pub enum EncryptionState {
- EnabledLocked,
- EnabledUnlocked,
- Disabled,
-}
-
-#[derive(Debug)]
-pub enum BackendRequest {
- OpenWallet {
- file_path: PathBuf,
- wallet_type: WalletType,
- },
- // This will remove the old file if it already exists.
- // The frontend should check if this is what the user really wants.
- RecoverWallet {
- wallet_args: WalletTypeArgs,
- file_path: PathBuf,
- import: ImportOrCreate,
- wallet_type: WalletType,
- },
- CloseWallet(WalletId),
-
- UpdateEncryption {
- wallet_id: WalletId,
- action: EncryptionAction,
- },
-
- NewAccount {
- wallet_id: WalletId,
-
- /// New account name (will be trimmed first and if empty, no name will be used
- /// because the wallet controller does not allow empty names)
- name: String,
- },
-
- NewAddress(WalletId, AccountId),
- ToggleStaking(WalletId, AccountId, bool),
- SendAmount(SendRequest),
- StakeAmount(StakeRequest),
- DecommissionPool(DecommissionPoolRequest),
- CreateDelegation(CreateDelegationRequest),
- DelegateStaking(DelegateStakingRequest),
- SendDelegationToAddress(SendDelegateToAddressRequest),
-
- SubmitTx {
- wallet_id: WalletId,
- tx: SignedTransactionWrapper,
- },
-
- TransactionList {
- wallet_id: WalletId,
- account_id: AccountId,
- skip: usize,
- },
-
- ConsoleCommand {
- wallet_id: WalletId,
- account_id: AccountId,
- command: String,
- },
-
- Shutdown,
-}
-
-#[derive(Debug, Clone)]
-pub enum BackendEvent {
- ChainInfo(ChainInfo),
- P2p(P2pEvent),
-
- OpenWallet(Result),
- ImportWallet(Result),
- CloseWallet(WalletId),
-
- UpdateEncryption(Result<(WalletId, EncryptionState), BackendError>),
-
- NewAccount(Result<(WalletId, AccountId, AccountInfo), BackendError>),
-
- WalletBestBlock(WalletId, (Id, BlockHeight)),
- Balance(WalletId, AccountId, Balances),
- StakingBalance(WalletId, AccountId, BTreeMap),
- DelegationsBalance(
- WalletId,
- AccountId,
- BTreeMap,
- ),
- NewAddress(Result),
- ToggleStaking(Result<(WalletId, AccountId, bool), BackendError>),
- SendAmount(Result),
- StakeAmount(Result),
- DecommissionPool(Result),
- CreateDelegation(Result),
- DelegateStaking(Result<(TransactionInfo, DelegationId), BackendError>),
- SendDelegationToAddress(Result),
- Broadcast(Result),
-
- TransactionList(WalletId, AccountId, Result),
-
- ConsoleResponse(WalletId, AccountId, Result),
-}
diff --git a/node-gui/backend/src/p2p_event_handler.rs b/node-gui/backend/src/p2p_event_handler.rs
deleted file mode 100644
index 97e8f9bbf8..0000000000
--- a/node-gui/backend/src/p2p_event_handler.rs
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::sync::Arc;
-
-use anyhow::Context;
-use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender, unbounded_channel};
-
-use p2p::{P2pEvent, interface::p2p_interface::P2pInterface};
-use subsystem::Handle;
-use utils::tap_log::TapLog;
-
-use super::{backend_impl::Backend, messages::BackendEvent};
-
-pub struct P2pEventHandler {
- p2p_event_rx: UnboundedReceiver,
- event_tx: UnboundedSender,
-}
-
-impl P2pEventHandler {
- pub async fn new(
- p2p: &Handle,
- event_tx: UnboundedSender,
- ) -> anyhow::Result {
- // TODO: Fix race in p2p events subscribe (if some peers are connected before the subscription is complete)
-
- // TODO: need a way to propagate subsystem initialization errors. E.g. if the p2p port is busy, we'll
- // currently report "Error subscribing to P2P events: Callee subsystem did not respond", which is not
- // very informative.
- // Same for ChainstateEventHandler.
-
- let (p2p_event_tx, p2p_event_rx) = unbounded_channel();
- let error_context = "Error subscribing to P2P events";
- p2p.call_mut(|this| {
- this.subscribe_to_events(Arc::new(move |p2p_event: P2pEvent| {
- _ = p2p_event_tx
- .send(p2p_event)
- .log_err_pfx("P2P subscriber failed to send new event");
- }))
- })
- .await
- .context(error_context)?
- .context(error_context)?;
-
- Ok(Self {
- p2p_event_rx,
- event_tx,
- })
- }
-
- pub async fn run(&mut self) {
- // Must be cancel-safe!
- loop {
- let p2p_event_opt = self.p2p_event_rx.recv().await;
- match p2p_event_opt {
- Some(event) => {
- Backend::send_event(&self.event_tx, BackendEvent::P2p(event));
- }
- None => {
- // Node is stopped
- return;
- }
- }
- }
- }
-}
diff --git a/node-gui/backend/src/wallet_events/mod.rs b/node-gui/backend/src/wallet_events/mod.rs
deleted file mode 100644
index 35872e6146..0000000000
--- a/node-gui/backend/src/wallet_events/mod.rs
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use common::chain::OutPointSourceId;
-use crypto::key::hdkd::u31::U31;
-use tokio::sync::mpsc::UnboundedSender;
-use wallet::wallet_events::WalletEvents;
-use wallet_types::WalletTx;
-
-use super::messages::WalletId;
-
-pub struct GuiWalletEvents {
- wallet_id: WalletId,
- wallet_updated_tx: UnboundedSender,
-}
-
-impl GuiWalletEvents {
- pub fn new(wallet_id: WalletId, wallet_updated_tx: UnboundedSender) -> Self {
- GuiWalletEvents {
- wallet_id,
- wallet_updated_tx,
- }
- }
-
- pub fn notify(&self) {
- let _ = self.wallet_updated_tx.send(self.wallet_id);
- }
-}
-
-impl WalletEvents for GuiWalletEvents {
- fn new_block(&self) {
- self.notify();
- }
-
- fn set_transaction(&self, _id: U31, _tx: &WalletTx) {
- self.notify();
- }
-
- fn del_transaction(&self, _id: U31, _source: OutPointSourceId) {
- self.notify();
- }
-}
diff --git a/node-gui/build.rs b/node-gui/build.rs
deleted file mode 100644
index a6cf894fd7..0000000000
--- a/node-gui/build.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#[cfg(windows)]
-fn main() -> Result<(), Box> {
- use std::env;
- use std::fs;
- use winres::WindowsResource;
-
- if fs::metadata("app.manifest").is_err() {
- return Err(format!("app.manifest not found in: {:?}", env::current_dir()?).into());
- }
-
- let mut res = WindowsResource::new();
- res.set_icon("../build-tools/assets/logo.ico");
- res.set_manifest_file("app.manifest");
-
- res.compile()?;
-
- println!("Resource compilation successful");
- Ok(())
-}
-
-#[cfg(not(windows))]
-fn main() {}
diff --git a/node-gui/icon.rc b/node-gui/icon.rc
deleted file mode 100644
index 135144e947..0000000000
--- a/node-gui/icon.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-#pragma code_page(65001) // UTF-8 encoding
-IDI_ICON1 ICON "../build-tools/assets/logo.ico"
-
-// Add this manifest section
-1 24 "app.manifest"
\ No newline at end of file
diff --git a/node-gui/src/main.rs b/node-gui/src/main.rs
deleted file mode 100644
index 9aac38e553..0000000000
--- a/node-gui/src/main.rs
+++ /dev/null
@@ -1,607 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#![windows_subsystem = "windows"]
-
-mod main_window;
-mod widgets;
-
-use std::{convert::identity, env};
-
-use heck::ToUpperCamelCase as _;
-use iced::{
- Element, Length, Settings, Size, Subscription, Task, Theme,
- advanced::graphics::core::window,
- executor, font,
- widget::{Text, column, row, text, tooltip},
-};
-use iced_aw::widgets::spinner::Spinner;
-use tokio::sync::mpsc::UnboundedReceiver;
-
-use common::chain::config::ChainType;
-use main_window::{MainWindow, MainWindowMessage};
-use node_gui_backend::{
- BackendControls, BackendSender, InitNetwork, NodeInitializationOutcome, WalletMode,
- messages::{BackendEvent, BackendRequest},
- node_initialize,
-};
-use node_lib::{CLEAN_DATA_OPTION_LONG_NAME, NodeType};
-
-const COLD_WALLET_TOOLTIP_TEXT: &str = "Start the wallet in Cold mode without connecting to the network or any nodes. The Cold mode is made to run the wallet on an air-gapped machine without internet connection for storage of keys of high-value. For example, pool decommission keys.";
-const HOT_WALLET_TOOLTIP_TEXT: &str = "Start the wallet in Hot mode and connect to the network.";
-
-const MAIN_NETWORK_TOOLTIP: &str = "The 'Mainnet' is the main network that has coins with value.";
-const TEST_NETWORK_TOOLTIP: &str = "The 'Testnet' is the network with coins that have no value, but is used for testing various applications before deploying them on Mainnet.";
-
-// Note: these are the default values used by iced.
-const INITIAL_MAIN_WINDOW_WIDTH: f32 = 1024.0;
-const INITIAL_MAIN_WINDOW_HEIGHT: f32 = 768.0;
-
-utils::enable_rust_backtrace!();
-
-pub fn main() -> iced::Result {
- let initial_opts = node_lib::Options::from_args(std::env::args_os(), NodeType::NodeGui);
-
- iced::application(title, update, view)
- .executor::()
- .subscription(subscription)
- .theme(theme)
- .window(window::Settings {
- size: Size::new(INITIAL_MAIN_WINDOW_WIDTH, INITIAL_MAIN_WINDOW_HEIGHT),
- exit_on_close_request: false,
- ..Default::default()
- })
- .settings(Settings {
- id: Some("mintlayer-gui".to_owned()),
- antialiasing: true,
- ..Settings::default()
- })
- .font(iced_fonts::REQUIRED_FONT_BYTES)
- .run_with(|| initialize(initial_opts))
-}
-
-enum GuiState {
- Initial {
- initial_options: node_lib::Options,
- },
- SelectNetwork {
- top_level_options: node_lib::TopLevelOptions,
- },
- SelectWalletMode {
- resolved_options: node_lib::OptionsWithResolvedCommand,
- },
- Loading {
- wallet_mode: WalletMode,
- chain_type: ChainType,
- },
- Loaded {
- backend_sender: BackendSender,
- main_window: MainWindow,
- },
- InitializationInterrupted(InitializationInterruptionReason),
-}
-
-impl From for GuiState {
- fn from(value: InitializationFailure) -> Self {
- Self::InitializationInterrupted(InitializationInterruptionReason::Failure(value))
- }
-}
-
-enum InitializationInterruptionReason {
- Failure(InitializationFailure),
- DataDirCleanedUp,
-}
-
-struct InitializationFailure {
- message: String,
-}
-
-#[derive(Debug)]
-pub enum Message {
- InitNetwork(InitNetwork),
- InitWalletMode(WalletMode),
- FromBackend(
- UnboundedReceiver,
- UnboundedReceiver,
- BackendEvent,
- ),
- Loaded(anyhow::Result),
- FontLoaded(Result<(), font::Error>),
- EventOccurred(iced::Event),
- ShuttingDownFinished,
- MainWindowMessage(MainWindowMessage),
-}
-
-fn initialize(initial_options: node_lib::Options) -> (GuiState, Task) {
- (
- GuiState::Initial { initial_options },
- font::load(iced_fonts::BOOTSTRAP_FONT_BYTES).map(Message::FontLoaded),
- )
-}
-
-fn chain_type_to_string(chain_type: ChainType) -> String {
- chain_type.name().to_upper_camel_case()
-}
-
-fn title(state: &GuiState) -> String {
- let version = env!("CARGO_PKG_VERSION");
- match state {
- GuiState::Initial { .. } => "Mintlayer Node - Initializing...".into(),
- GuiState::SelectNetwork { .. } => "Mintlayer Node - Selecting network...".into(),
- GuiState::SelectWalletMode { resolved_options } => {
- format!(
- "Mintlayer Node - {} - Selecting mode...",
- chain_type_to_string(resolved_options.command.chain_type())
- )
- }
- GuiState::Loading {
- wallet_mode: _,
- chain_type,
- } => format!(
- "Mintlayer Node - {} - Loading...",
- chain_type_to_string(*chain_type)
- ),
- GuiState::Loaded {
- backend_sender: _,
- main_window,
- } => {
- format!(
- "Mintlayer Node - {} - v{version}",
- chain_type_to_string(*main_window.node_state().chain_config().chain_type())
- )
- }
- GuiState::InitializationInterrupted(reason) => match reason {
- InitializationInterruptionReason::Failure(_) => "Mintlayer initialization error".into(),
- InitializationInterruptionReason::DataDirCleanedUp => {
- "Mintlayer data directory cleaned up".into()
- }
- },
- }
-}
-
-// Update the state once the wallet mode has been selected/decided upon.
-fn update_on_mode_selected(
- state: &mut GuiState,
- wallet_mode: WalletMode,
- opts: node_lib::OptionsWithResolvedCommand,
-) -> Task {
- *state = GuiState::Loading {
- wallet_mode,
- chain_type: opts.command.chain_type(),
- };
-
- Task::perform(node_initialize(opts, wallet_mode), Message::Loaded)
-}
-
-fn update(state: &mut GuiState, message: Message) -> Task {
- match state {
- GuiState::Initial { initial_options } => match message {
- Message::FontLoaded(Ok(())) => match &initial_options.command {
- Some(command) => {
- let resolved_options = node_lib::OptionsWithResolvedCommand {
- top_level: initial_options.top_level.clone(),
- command: command.clone(),
- };
-
- if resolved_options.top_level.clean_data
- || resolved_options.top_level.import_bootstrap_file.is_some()
- {
- // If "clean data" option was set, selecting the wallet mode makes no sense;
- // since the option is ignored in the cold mode, we use the hot one.
- // Same applies to "import bootstrap file" - even though we don't support
- // bootstrapping in node-gui at this moment, we still need to show the
- // corresponding error, and asking for wallet mode before doing it makes
- // no sense either.
- update_on_mode_selected(state, WalletMode::Hot, resolved_options)
- } else {
- *state = GuiState::SelectWalletMode { resolved_options };
- Task::none()
- }
- }
- None => {
- *state = GuiState::SelectNetwork {
- top_level_options: initial_options.top_level.clone(),
- };
- Task::none()
- }
- },
- Message::FontLoaded(Err(_)) => {
- *state = InitializationFailure {
- message: "Failed to load font".into(),
- }
- .into();
- Task::none()
- }
- Message::ShuttingDownFinished => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- iced::window::get_latest().and_then(iced::window::close)
- } else {
- // While the screen is loading, ignore all events
- Task::none()
- }
- }
- Message::Loaded(_)
- | Message::InitNetwork(_)
- | Message::InitWalletMode(_)
- | Message::FromBackend(_, _, _)
- | Message::MainWindowMessage(_) => unreachable!(),
- },
- GuiState::SelectNetwork { top_level_options } => match message {
- Message::InitNetwork(init) => {
- let opts = node_lib::OptionsWithResolvedCommand {
- top_level: top_level_options.clone(),
- command: match init {
- InitNetwork::Mainnet => node_lib::Command::Mainnet(Default::default()),
- InitNetwork::Testnet => node_lib::Command::Testnet(Default::default()),
- InitNetwork::Regtest => node_lib::Command::Regtest(Default::default()),
- },
- };
- *state = GuiState::SelectWalletMode {
- resolved_options: opts,
- };
- Task::none()
- }
- Message::ShuttingDownFinished => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- iced::window::get_latest().and_then(iced::window::close)
- } else {
- // While the screen is loading, ignore all events
- Task::none()
- }
- }
- Message::Loaded(_)
- | Message::InitWalletMode(_)
- | Message::FontLoaded(_)
- | Message::FromBackend(_, _, _)
- | Message::MainWindowMessage(_) => unreachable!(),
- },
- GuiState::SelectWalletMode { resolved_options } => {
- match message {
- Message::InitWalletMode(mode) => {
- let resolved_options = resolved_options.clone();
- update_on_mode_selected(state, mode, resolved_options)
- }
- Message::ShuttingDownFinished => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- iced::window::get_latest().and_then(iced::window::close)
- } else {
- // While the screen is loading, ignore all events
- Task::none()
- }
- }
- Message::InitNetwork(_)
- | Message::Loaded(_)
- | Message::FontLoaded(_)
- | Message::FromBackend(_, _, _)
- | Message::MainWindowMessage(_) => unreachable!(),
- }
- }
- GuiState::Loading {
- wallet_mode,
- chain_type: _,
- } => match message {
- Message::InitNetwork(_)
- | Message::InitWalletMode(_)
- | Message::FromBackend(_, _, _) => unreachable!(),
- Message::Loaded(Ok(init_outcome)) => match init_outcome {
- NodeInitializationOutcome::BackendControls(backend_controls) => {
- let BackendControls {
- initialized_node,
- backend_sender,
- backend_receiver,
- low_priority_backend_receiver,
- } = backend_controls;
- *state = GuiState::Loaded {
- backend_sender,
- main_window: MainWindow::new(initialized_node, *wallet_mode),
- };
-
- recv_backend_command(backend_receiver, low_priority_backend_receiver)
- }
- NodeInitializationOutcome::DataDirCleanedUp => {
- *state = GuiState::InitializationInterrupted(
- InitializationInterruptionReason::DataDirCleanedUp,
- );
- Task::none()
- }
- },
- Message::Loaded(Err(e)) => {
- *state = InitializationFailure {
- // Note: we need to use the alternate selector in order to show both anyhow::Error's context
- // and the original error message.
- message: format!("{e:#}"),
- }
- .into();
- Task::none()
- }
- Message::FontLoaded(status) => {
- if status.is_err() {
- *state = InitializationFailure {
- message: "Failed to load font".into(),
- }
- .into();
- }
- Task::none()
- }
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- panic!("Attempted shutdown during initialization")
- } else {
- // While the screen is loading, ignore all events
- Task::none()
- }
- }
- Message::ShuttingDownFinished => Task::none(),
- Message::MainWindowMessage(_) => Task::none(),
- },
- GuiState::Loaded {
- backend_sender,
- main_window,
- } => match message {
- Message::FromBackend(
- backend_receiver,
- low_priority_backend_receiver,
- backend_event,
- ) => Task::batch([
- main_window
- .update(
- MainWindowMessage::FromBackend(backend_event),
- backend_sender,
- )
- .map(Message::MainWindowMessage),
- recv_backend_command(backend_receiver, low_priority_backend_receiver),
- ]),
- Message::InitNetwork(_) | Message::InitWalletMode(_) | Message::Loaded(_) => {
- unreachable!("Already loaded")
- }
- Message::FontLoaded(status) => {
- if status.is_err() {
- *state = InitializationFailure {
- message: "Failed to load font".into(),
- }
- .into();
- }
- Task::none()
- }
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- // TODO: this event doesn't cover the case of closing the Window through Cmd+Q in MacOS
- backend_sender.send(BackendRequest::Shutdown);
- Task::none()
- } else {
- Task::none()
- }
- }
- Message::ShuttingDownFinished => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- Message::MainWindowMessage(msg) => {
- main_window.update(msg, backend_sender).map(Message::MainWindowMessage)
- }
- },
- GuiState::InitializationInterrupted { .. } => match message {
- Message::InitNetwork(_)
- | Message::InitWalletMode(_)
- | Message::FromBackend(_, _, _) => unreachable!(),
- Message::Loaded(_) => Task::none(),
- Message::FontLoaded(_) => Task::none(),
- Message::EventOccurred(event) => {
- if let iced::Event::Window(iced::window::Event::CloseRequested) = event {
- iced::window::get_latest().and_then(iced::window::close)
- } else {
- Task::none()
- }
- }
- Message::ShuttingDownFinished => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- Message::MainWindowMessage(_) => Task::none(),
- },
- }
-}
-
-#[allow(clippy::float_arithmetic)]
-fn view(state: &GuiState) -> Element<'_, Message> {
- match state {
- GuiState::Initial { .. } => {
- iced::widget::text("Loading fonts...".to_string()).size(32).into()
- }
- GuiState::SelectNetwork { .. } => {
- let error_box = column![
- iced::widget::text("Please choose the network you want to use".to_string())
- .size(32),
- row![
- iced::widget::button(text("Mainnet")).on_press(InitNetwork::Mainnet),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- MAIN_NETWORK_TOOLTIP,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- iced::widget::button(text("Testnet")).on_press(InitNetwork::Testnet),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- TEST_NETWORK_TOOLTIP,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- ]
- .align_x(iced::Alignment::Center)
- .spacing(5);
-
- let res: Element =
- iced::widget::container(error_box).center(Length::Fill).into();
-
- res.map(Message::InitNetwork)
- }
-
- GuiState::SelectWalletMode { .. } => {
- let error_box = column![
- iced::widget::text("Please choose the wallet mode".to_string()).size(32),
- row![
- iced::widget::button(text("Hot")).on_press(WalletMode::Hot),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- HOT_WALLET_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- iced::widget::button(text("Cold")).on_press(WalletMode::Cold),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- COLD_WALLET_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- ]
- .align_x(iced::Alignment::Center)
- .spacing(5);
-
- let res: Element =
- iced::widget::container(error_box).center(Length::Fill).into();
-
- res.map(Message::InitWalletMode)
- }
-
- GuiState::Loading { .. } => {
- // Create a spinner. By default, the spinner is simply a dot of the radius "circle_radius"
- // that goes in a circle whose size is the spinner's widget size. To make it look a bit
- // nicer we also add a light gray circle border around the whole thing.
- let spinner_size = 40.0;
- let spinner_dot_size = 3.0;
- let border_width = 2.0;
- let border_color = iced::Color::from_rgb8(192, 192, 192);
-
- let spinner = Spinner::new()
- .width(spinner_size - 2.0 * border_width)
- .height(spinner_size - 2.0 * border_width)
- .circle_radius(spinner_dot_size);
-
- iced::widget::container(
- iced::widget::container(spinner)
- .width(spinner_size)
- .height(spinner_size)
- .padding(border_width)
- .style(move |_| iced::widget::container::Style {
- border: iced::Border {
- width: border_width,
- radius: (spinner_size / 2.0).into(),
- color: border_color,
- },
- ..Default::default()
- }),
- )
- .center(Length::Fill)
- .into()
- }
-
- GuiState::Loaded {
- backend_sender: _,
- main_window,
- } => main_window.view().map(Message::MainWindowMessage),
-
- GuiState::InitializationInterrupted(reason) => {
- let header_font_size = 32;
- let text_font_size = 20;
-
- let error_box = match reason {
- InitializationInterruptionReason::Failure(InitializationFailure { message }) => {
- column![
- iced::widget::text("Mintlayer-core node initialization failed".to_string())
- .size(header_font_size),
- iced::widget::text(message.clone()).size(text_font_size)
- ]
- }
- InitializationInterruptionReason::DataDirCleanedUp => {
- column![
- iced::widget::text("Data directory is now clean").size(header_font_size),
- iced::widget::text(format!(
- "Please restart the node without the `--{}` flag",
- CLEAN_DATA_OPTION_LONG_NAME
- ))
- .size(text_font_size)
- ]
- }
- };
- let error_box = error_box
- .extend([iced::widget::button(text("Close")).on_press(()).into()])
- .align_x(iced::Alignment::Center)
- .spacing(5);
-
- let res: Element<()> = iced::widget::container(error_box).center(Length::Fill).into();
-
- res.map(|_| Message::ShuttingDownFinished)
- }
- }
-}
-
-fn theme(_state: &GuiState) -> Theme {
- Theme::Light
-}
-
-fn subscription(_state: &GuiState) -> Subscription {
- iced::event::listen().map(Message::EventOccurred)
-}
-
-fn recv_backend_command(
- mut backend_receiver: UnboundedReceiver,
- mut low_priority_backend_receiver: UnboundedReceiver,
-) -> Task {
- Task::perform(
- async move {
- tokio::select! {
- // Make sure we process low priority events at the end
- biased;
-
- msg_opt = backend_receiver.recv() => {
- match msg_opt {
- Some(msg) => Message::FromBackend(backend_receiver, low_priority_backend_receiver, msg),
- None => Message::ShuttingDownFinished,
- }
- }
- msg_opt = low_priority_backend_receiver.recv() => {
- match msg_opt {
- Some(msg) => Message::FromBackend(backend_receiver, low_priority_backend_receiver, msg),
- None => Message::ShuttingDownFinished,
- }
- }
- }
- },
- identity,
- )
-}
diff --git a/node-gui/src/main_window/main_menu.rs b/node-gui/src/main_window/main_menu.rs
deleted file mode 100644
index 213a4abb9e..0000000000
--- a/node-gui/src/main_window/main_menu.rs
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Color, Element, Length, Theme, alignment,
- widget::{button, container, text},
-};
-use iced_aw::menu::{Item, Menu, MenuBar};
-use wallet_types::wallet_type::WalletType;
-
-use crate::WalletMode;
-
-#[derive(Debug, Clone)]
-pub enum MenuMessage {
- NoOp,
- CreateNewWallet { wallet_type: WalletType },
- RecoverWallet { wallet_type: WalletType },
- OpenWallet { wallet_type: WalletType },
- Exit,
-}
-
-pub struct MainMenu {
- wallet_mode: WalletMode,
-}
-
-impl MainMenu {
- pub fn new(wallet_mode: WalletMode) -> Self {
- Self { wallet_mode }
- }
-
- pub fn view(&self) -> Element<'_, MenuMessage> {
- let file_menu = make_menu_file(self.wallet_mode);
-
- let menu_bar = MenuBar::new(vec![file_menu]).spacing(4.0).check_bounds_width(30.0);
-
- let c = iced::widget::column![container(menu_bar)];
-
- c.into()
- }
-}
-
-fn base_button<'a>(
- content: impl Into>,
- msg: MenuMessage,
-) -> button::Button<'a, MenuMessage> {
- button(content)
- .padding([4, 8])
- .style(|theme, status| {
- let plt = theme.extended_palette();
- match status {
- button::Status::Active => button::Style {
- text_color: plt.background.base.text,
- border: iced::Border {
- radius: 4.0.into(),
- ..Default::default()
- },
- background: Some(Color::TRANSPARENT.into()),
- ..Default::default()
- },
- button::Status::Hovered => button::Style {
- text_color: plt.primary.weak.text,
- background: Some(plt.primary.weak.color.into()),
- border: iced::Border {
- radius: 4.0.into(),
- ..Default::default()
- },
- ..Default::default()
- },
- button::Status::Pressed | button::Status::Disabled => button::Style::default(),
- }
- })
- .on_press(msg)
-}
-
-fn labeled_button<'a>(label: &'a str, msg: MenuMessage) -> button::Button<'a, MenuMessage> {
- base_button::<'a>(
- text(label)
- .width(Length::Fixed(270.0))
- .height(Length::Fixed(25.0))
- .align_y(alignment::Vertical::Center),
- msg,
- )
-}
-
-fn menu_item(label: &str, msg: MenuMessage) -> Item<'_, MenuMessage, Theme, iced::Renderer> {
- // Note: if this width is smaller than the text, the menu item will drop the whole last word.
- Item::new(labeled_button(label, msg).width(Length::Fixed(300.0)))
-}
-
-fn make_menu_file<'a>(wallet_mode: WalletMode) -> Item<'a, MenuMessage, Theme, iced::Renderer> {
- Item::with_menu(
- labeled_button("File", MenuMessage::NoOp),
- Menu::new(match wallet_mode {
- WalletMode::Hot => {
- let mut menu = vec![
- menu_item(
- "Create new Software wallet",
- MenuMessage::CreateNewWallet {
- wallet_type: WalletType::Hot,
- },
- ),
- menu_item(
- "Recover Software wallet",
- MenuMessage::RecoverWallet {
- wallet_type: WalletType::Hot,
- },
- ),
- menu_item(
- "Open Software wallet",
- MenuMessage::OpenWallet {
- wallet_type: WalletType::Hot,
- },
- ),
- ];
- #[cfg(feature = "ledger")]
- {
- menu.push(menu_item(
- "(Beta) Create new Ledger wallet",
- MenuMessage::CreateNewWallet {
- wallet_type: WalletType::Ledger,
- },
- ));
- menu.push(menu_item(
- "(Beta) Recover from Ledger wallet",
- MenuMessage::RecoverWallet {
- wallet_type: WalletType::Ledger,
- },
- ));
- menu.push(menu_item(
- "(Beta) Open Ledger wallet",
- MenuMessage::OpenWallet {
- wallet_type: WalletType::Ledger,
- },
- ));
- }
- #[cfg(feature = "trezor")]
- {
- menu.push(menu_item(
- "(Beta) Create new Trezor wallet",
- MenuMessage::CreateNewWallet {
- wallet_type: WalletType::Trezor,
- },
- ));
- menu.push(menu_item(
- "(Beta) Recover from Trezor wallet",
- MenuMessage::RecoverWallet {
- wallet_type: WalletType::Trezor,
- },
- ));
- menu.push(menu_item(
- "(Beta) Open Trezor wallet",
- MenuMessage::OpenWallet {
- wallet_type: WalletType::Trezor,
- },
- ));
- }
-
- // TODO: enable setting when needed
- // menu.push(menu_item("Settings", MenuMessage::NoOp));
- menu.push(menu_item("Exit", MenuMessage::Exit));
- menu
- }
- WalletMode::Cold => {
- vec![
- menu_item(
- "Create new Cold wallet",
- MenuMessage::CreateNewWallet {
- wallet_type: WalletType::Cold,
- },
- ),
- menu_item(
- "Recover Cold wallet",
- MenuMessage::RecoverWallet {
- wallet_type: WalletType::Cold,
- },
- ),
- menu_item(
- "Open Cold wallet",
- MenuMessage::OpenWallet {
- wallet_type: WalletType::Cold,
- },
- ),
- // TODO: enable setting when needed
- // menu_item("Settings", MenuMessage::NoOp),
- menu_item("Exit", MenuMessage::Exit),
- ]
- }
- })
- .width(300),
- )
-}
diff --git a/node-gui/src/main_window/main_widget/mod.rs b/node-gui/src/main_window/main_widget/mod.rs
deleted file mode 100644
index ec2f532396..0000000000
--- a/node-gui/src/main_window/main_widget/mod.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-pub mod tabs;
-
-use iced::{Element, Task};
-use node_gui_backend::{BackendSender, messages::WalletId};
-use wallet_types::wallet_type::WalletType;
-
-use crate::WalletMode;
-
-use super::NodeState;
-
-#[derive(Debug, Clone)]
-pub enum MainWidgetMessage {
- WalletAdded {
- wallet_id: WalletId,
- wallet_type: WalletType,
- },
- WalletRemoved(WalletId),
- TabsMessage(tabs::TabsMessage),
-}
-
-pub struct MainWidget {
- tabs: tabs::TabsWidget,
-}
-
-impl MainWidget {
- pub fn new(wallet_mode: WalletMode) -> Self {
- Self {
- tabs: tabs::TabsWidget::new(wallet_mode),
- }
- }
-
- pub fn update(
- &mut self,
- msg: MainWidgetMessage,
- backend_sender: &BackendSender,
- ) -> Task {
- match msg {
- MainWidgetMessage::WalletAdded {
- wallet_id,
- wallet_type,
- } => Task::perform(async {}, move |_| {
- MainWidgetMessage::TabsMessage(tabs::TabsMessage::WalletAdded {
- wallet_id,
- wallet_type,
- })
- }),
- MainWidgetMessage::WalletRemoved(wallet_id) => Task::perform(async {}, move |_| {
- MainWidgetMessage::TabsMessage(tabs::TabsMessage::WalletRemoved(wallet_id))
- }),
- MainWidgetMessage::TabsMessage(tabs_message) => self
- .tabs
- .update(tabs_message, backend_sender)
- .map(MainWidgetMessage::TabsMessage),
- }
- }
-
- pub fn view(&self, node_state: &NodeState) -> Element<'_, MainWidgetMessage> {
- self.tabs.view(node_state).map(MainWidgetMessage::TabsMessage)
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/cold_wallet.rs b/node-gui/src/main_window/main_widget/tabs/cold_wallet.rs
deleted file mode 100644
index 1f9344197d..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/cold_wallet.rs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use common::chain::ChainConfig;
-use iced::{
- Element, Length,
- widget::{Text, column},
-};
-use iced_aw::tab_bar::TabLabel;
-
-use crate::main_window::NodeState;
-
-use super::{Tab, TabsMessage};
-
-pub struct ColdWalletTab {}
-
-impl ColdWalletTab {
- pub fn new() -> Self {
- ColdWalletTab {}
- }
-}
-
-fn get_network_type_capitalized(chain_config: &ChainConfig) -> String {
- let mut network_type = chain_config.chain_type().name().to_string();
- format!("{}{network_type}", network_type.remove(0).to_uppercase())
-}
-
-impl Tab for ColdWalletTab {
- type Message = TabsMessage;
-
- fn tab_label(&self, _node_state: &NodeState) -> TabLabel {
- TabLabel::IconText(
- iced_fonts::Bootstrap::Info.into(),
- String::from("Cold wallet summary"),
- )
- }
-
- fn content(&self, node_state: &NodeState) -> Element<'_, Self::Message> {
- let network_type = get_network_type_capitalized(node_state.chain_config());
-
- let msg = format!(
- "Running in cold wallet mode on {network_type}\nOpen a wallet from the file menu to start"
- );
- column![Text::new(msg).size(16)]
- .padding(10)
- .spacing(15)
- .height(Length::Fill)
- .width(Length::Fill)
- .into()
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/mod.rs b/node-gui/src/main_window/main_widget/tabs/mod.rs
deleted file mode 100644
index bc4d1ca7e6..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/mod.rs
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{Element, Length, Task};
-use iced_aw::{TabLabel, Tabs};
-use strum::EnumCount;
-use wallet_types::wallet_type::WalletType;
-
-use node_gui_backend::{BackendSender, messages::WalletId};
-
-use crate::{WalletMode, main_window::NodeState};
-
-use self::{
- cold_wallet::ColdWalletTab,
- networking::{NetworkingMessage, NetworkingTab},
- settings::{SettingsMessage, SettingsTab, TabBarPosition},
- summary::{SummaryMessage, SummaryTab},
- wallet::{WalletMessage, WalletTab},
-};
-
-pub mod cold_wallet;
-pub mod networking;
-pub mod settings;
-pub mod summary;
-pub mod wallet;
-
-#[derive(Debug, Clone)]
-pub enum TabsMessage {
- TabSelected(usize),
- WalletAdded {
- wallet_id: WalletId,
- wallet_type: WalletType,
- },
- WalletRemoved(WalletId),
- Summary(SummaryMessage),
- Networking(NetworkingMessage),
- Settings(SettingsMessage),
- WalletMessage(WalletId, WalletMessage),
-}
-
-#[derive(EnumCount, Debug, Clone, Default)]
-enum TabIndex {
- #[default]
- Summary = 0,
- Networking = 1,
- // TODO: enable setting when needed
- // Settings = 2,
-
- // Notice that the wallet tabs are added dynamically to these variants, so a higher index may be valid
-}
-
-impl TabIndex {
- fn into_usize(self) -> usize {
- self as usize
- }
-}
-
-pub struct TabsWidget {
- active_tab: usize,
- summary_tab: SummaryTab,
- networking_tab: NetworkingTab,
- settings_tab: SettingsTab,
- cold_wallet_tab: ColdWalletTab,
- wallets: Vec,
- wallet_mode: WalletMode,
-}
-
-impl TabsWidget {
- pub fn new(wallet_mode: WalletMode) -> Self {
- TabsWidget {
- active_tab: TabIndex::default().into_usize(),
- summary_tab: SummaryTab::new(),
- networking_tab: NetworkingTab::new(),
- settings_tab: SettingsTab::new(),
- cold_wallet_tab: ColdWalletTab::new(),
- wallets: Vec::new(),
- wallet_mode,
- }
- }
-
- pub fn last_wallet_tab_index(&self) -> usize {
- TabIndex::COUNT + self.wallets.len() - 1
- }
-
- pub fn view(&self, node_state: &NodeState) -> Element<'_, TabsMessage> {
- let position = self.settings_tab.settings().tab_bar_position.unwrap_or_default();
-
- let mut tabs = Tabs::new(TabsMessage::TabSelected).icon_font(iced_fonts::BOOTSTRAP_FONT);
- tabs = match self.wallet_mode {
- WalletMode::Hot => tabs
- .push(
- TabIndex::Summary as usize,
- self.summary_tab.tab_label(node_state),
- self.summary_tab.content(node_state),
- )
- .push(
- TabIndex::Networking as usize,
- self.networking_tab.tab_label(node_state),
- self.networking_tab.content(node_state),
- ),
- WalletMode::Cold => tabs.push(
- TabIndex::Summary as usize,
- self.cold_wallet_tab.tab_label(node_state),
- self.cold_wallet_tab.content(node_state),
- ),
- };
- // TODO: enable settings tab when needed
- //.push(
- // TabIndex::Settings as usize,
- // self.settings_tab.tab_label(node_state),
- // self.settings_tab.content(node_state),
- //);
-
- for (idx, wallet) in self.wallets.iter().enumerate() {
- tabs = tabs.push(
- idx + TabIndex::COUNT,
- wallet.tab_label(node_state),
- wallet.content(node_state),
- )
- }
-
- tabs.tab_bar_position(match position {
- TabBarPosition::Top => iced_aw::TabBarPosition::Top,
- TabBarPosition::Bottom => iced_aw::TabBarPosition::Bottom,
- })
- .set_active_tab(&self.active_tab)
- .height(Length::Fill)
- .tab_bar_max_height(70.0)
- .into()
- }
-
- pub fn update(
- &mut self,
- msg: TabsMessage,
- backend_sender: &BackendSender,
- ) -> Task {
- match msg {
- TabsMessage::TabSelected(n) => {
- self.active_tab = n;
- Task::none()
- }
- TabsMessage::WalletAdded {
- wallet_id,
- wallet_type,
- } => {
- let wallet_tab = WalletTab::new(wallet_id, wallet_type);
- self.wallets.push(wallet_tab);
- self.active_tab = self.last_wallet_tab_index();
- Task::none()
- }
- TabsMessage::WalletRemoved(wallet_id) => {
- self.wallets.retain(|wallet_tab| wallet_tab.wallet_id() != wallet_id);
- if self.active_tab > self.last_wallet_tab_index() {
- self.active_tab = self.last_wallet_tab_index();
- }
- Task::none()
- }
- TabsMessage::Summary(message) => {
- self.summary_tab.update(message).map(TabsMessage::Summary)
- }
- TabsMessage::Networking(message) => {
- self.networking_tab.update(message).map(TabsMessage::Networking)
- }
- TabsMessage::Settings(message) => {
- self.settings_tab.update(message).map(TabsMessage::Settings)
- }
- TabsMessage::WalletMessage(wallet_id, message) => {
- if let Some(wallet_tab) =
- self.wallets.iter_mut().find(|wallet_tab| wallet_tab.wallet_id() == wallet_id)
- {
- wallet_tab
- .update(message, backend_sender)
- .map(move |msg| TabsMessage::WalletMessage(wallet_id, msg))
- } else {
- Task::none()
- }
- }
- }
- }
-}
-
-trait Tab {
- type Message;
-
- fn tab_label(&self, node_state: &NodeState) -> TabLabel;
-
- fn content(&self, node_state: &NodeState) -> Element<'_, Self::Message>;
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/networking.rs b/node-gui/src/main_window/main_widget/tabs/networking.rs
deleted file mode 100644
index f48af27e1e..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/networking.rs
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::fmt::Debug;
-
-use iced::{
- Element, Length, Task,
- widget::{Text, column, container},
-};
-use iced_aw::{Grid, GridRow, tab_bar::TabLabel};
-use networking::types::ConnectionDirection;
-
-use crate::main_window::NodeState;
-
-use super::{Tab, TabsMessage};
-
-#[derive(Debug, Clone)]
-pub enum NetworkingMessage {}
-
-pub struct NetworkingTab {}
-
-impl NetworkingTab {
- pub fn new() -> Self {
- NetworkingTab {}
- }
-
- pub fn update(&mut self, message: NetworkingMessage) -> Task {
- match message {}
- }
-}
-
-impl Tab for NetworkingTab {
- type Message = TabsMessage;
-
- fn tab_label(&self, _node_state: &NodeState) -> TabLabel {
- TabLabel::IconText(
- iced_fonts::Bootstrap::Wifi.into(),
- String::from("Networking"),
- )
- }
-
- fn content(&self, node_state: &NodeState) -> Element<'_, Self::Message> {
- let header = |text: &'static str| container(Text::new(text)).padding(5);
- let field = |text: String| container(Text::new(text)).padding(5);
- let peers = Grid::new().push(
- GridRow::new()
- .push(header("#"))
- .push(header("Socket"))
- .push(header("Inbound"))
- .push(header("User agent"))
- .push(header("Version")),
- );
- let peers = node_state
- .connected_peers
- .iter()
- .map(|(peer_id, peer)| {
- let direction_str = match peer.direction {
- ConnectionDirection::Inbound => "Inbound",
- ConnectionDirection::Outbound => "Outbound",
- };
-
- GridRow::new()
- .push(field(peer_id.to_string()))
- .push(field(peer.address.clone()))
- .push(field(direction_str.to_string()))
- .push(field(peer.user_agent.to_string()))
- .push(field(peer.version.to_string()))
- })
- .fold(peers, |grid, row| grid.push(row));
-
- column![
- Text::new("The following is a list of peers connected to your node").size(16),
- peers
- ]
- .padding(10)
- .spacing(15)
- .height(Length::Fill)
- .width(Length::Fill)
- .into()
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/settings.rs b/node-gui/src/main_window/main_widget/tabs/settings.rs
deleted file mode 100644
index 5e00adb453..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/settings.rs
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Element, Length, Task,
- widget::{Column, Container, Radio, Text, column},
-};
-use iced_aw::tab_bar::TabLabel;
-
-use crate::main_window::NodeState;
-
-use super::{Tab, TabsMessage};
-#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
-pub enum TabBarPosition {
- #[default]
- Top,
- Bottom,
-}
-
-impl TabBarPosition {
- pub const ALL: [TabBarPosition; 2] = [TabBarPosition::Top, TabBarPosition::Bottom];
-}
-
-impl From for String {
- fn from(position: TabBarPosition) -> Self {
- String::from(match position {
- TabBarPosition::Top => "Top",
- TabBarPosition::Bottom => "Bottom",
- })
- }
-}
-
-pub struct TabSettings {
- pub tab_bar_position: Option,
-}
-
-impl TabSettings {
- pub fn new() -> Self {
- TabSettings {
- tab_bar_position: Some(TabBarPosition::Top),
- }
- }
-}
-
-#[derive(Debug, Clone)]
-pub enum SettingsMessage {
- PositionSelected(TabBarPosition),
-}
-
-pub struct SettingsTab {
- settings: TabSettings,
-}
-
-impl SettingsTab {
- pub fn new() -> Self {
- SettingsTab {
- settings: TabSettings::new(),
- }
- }
-
- pub fn settings(&self) -> &TabSettings {
- &self.settings
- }
-
- pub fn update(&mut self, message: SettingsMessage) -> Task {
- match message {
- SettingsMessage::PositionSelected(position) => {
- self.settings.tab_bar_position = Some(position);
- Task::none()
- }
- }
- }
-}
-
-impl Tab for SettingsTab {
- type Message = TabsMessage;
-
- fn tab_label(&self, _node_state: &NodeState) -> TabLabel {
- TabLabel::IconText(iced_fonts::Bootstrap::Gear.into(), String::from("Settings"))
- }
-
- fn content(&self, _node_state: &NodeState) -> Element<'_, Self::Message> {
- let content: Element = Container::new(
- Column::new().push(Text::new("Tabs position").size(20)).push(
- TabBarPosition::ALL.iter().cloned().fold(
- Column::new().padding(10).spacing(10),
- |column, position| {
- column.push(
- Radio::new(
- position,
- position,
- self.settings().tab_bar_position,
- SettingsMessage::PositionSelected,
- )
- .size(16),
- )
- },
- ),
- ),
- )
- .into();
-
- column![content.map(TabsMessage::Settings)]
- .padding(10)
- .spacing(15)
- .height(Length::Fill)
- .width(Length::Fill)
- .into()
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/summary.rs b/node-gui/src/main_window/main_widget/tabs/summary.rs
deleted file mode 100644
index e7ea2aee15..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/summary.rs
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::fmt::Debug;
-
-use common::chain::ChainConfig;
-use iced::{
- Element, Length, Task,
- widget::{Text, column, tooltip},
-};
-use iced_aw::{Grid, GridRow, tab_bar::TabLabel};
-
-use crate::main_window::{NodeState, print_block_timestamp};
-
-use super::{Tab, TabsMessage};
-
-use serialization::hex::HexEncode;
-
-const NETWORK_TOOLTIP: &str = "Mintlayer supports multiple types of networks for different purposes. The 'Mainnet' is the main network that has coins with value. The 'Testnet' is the network with coins that have no value, but is used for testing various applications before deploying them on Mainnet.";
-
-#[derive(Debug, Clone)]
-pub enum SummaryMessage {}
-
-pub struct SummaryTab {}
-
-impl SummaryTab {
- pub fn new() -> Self {
- SummaryTab {}
- }
-
- pub fn update(&mut self, message: SummaryMessage) -> Task {
- match message {}
- }
-}
-
-fn get_network_type_capitalized(chain_config: &ChainConfig) -> String {
- let mut network_type = chain_config.chain_type().name().to_string();
- format!("{}{network_type}", network_type.remove(0).to_uppercase())
-}
-
-impl Tab for SummaryTab {
- type Message = TabsMessage;
-
- fn tab_label(&self, _node_state: &NodeState) -> TabLabel {
- TabLabel::IconText(iced_fonts::Bootstrap::Info.into(), String::from("Summary"))
- }
-
- fn content(&self, node_state: &NodeState) -> Element<'_, Self::Message> {
- let network_type = get_network_type_capitalized(node_state.chain_config());
- let chainstate = Grid::new()
- .push(
- GridRow::new().push(Text::new("Network ")).push(
- tooltip(
- Text::new(network_type),
- NETWORK_TOOLTIP,
- tooltip::Position::Bottom,
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ),
- )
- .push(
- GridRow::new()
- .push(Text::new("Best block id "))
- .push(Text::new(node_state.chain_info.best_block_id.hex_encode())),
- )
- .push(
- GridRow::new().push(Text::new("Best block height ")).push(Text::new(
- node_state.chain_info.best_block_height.to_string(),
- )),
- )
- .push(
- GridRow::new().push(Text::new("Best block timestamp (UTC) ")).push(Text::new(
- print_block_timestamp(node_state.chain_info.best_block_timestamp),
- )),
- );
-
- column![
- Text::new("The following is the syncing state of your node. In a healthy network, the block timestamp should be close to the current wall-clock time.").size(16),
- chainstate
- ]
- .padding(10)
- .spacing(15)
- .height(Length::Fill)
- .width(Length::Fill)
- .into()
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs b/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs
deleted file mode 100644
index a75a493958..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/addresses.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Element,
- widget::{Text, button, column, row, tooltip},
-};
-use iced_aw::{Grid, GridRow};
-
-use node_gui_backend::messages::AccountInfo;
-
-use super::WalletMessage;
-
-const NEW_ADDRESS_TOOLTIP_TEXT: &str = "You can create as many addresses as you desire; however, you're limited by how many addresses you create before using them. An address is labeled as used, when a transaction is found on the blockchain that utilizes that address.";
-
-pub fn view_addresses(
- account: &AccountInfo,
- still_syncing: Option,
-) -> Element<'static, WalletMessage> {
- let field = |text: String| iced::widget::container(Text::new(text)).padding(5);
- let addresses = account
- .addresses
- .iter()
- .map(|(index, address)| {
- GridRow::new().push(field(index.to_string())).push(field(address.clone())).push(
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .on_press(WalletMessage::CopyToClipboard(address.as_str().to_owned())),
- )
- })
- .fold(Grid::new(), |grid, row| grid.push(row));
-
- column![
- addresses,
- row![
- iced::widget::button(Text::new("New address"))
- .on_press(still_syncing.unwrap_or(WalletMessage::GetNewAddress)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- NEW_ADDRESS_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- ]
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/console.rs b/node-gui/src/main_window/main_widget/tabs/wallet/console.rs
deleted file mode 100644
index 94938fa252..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/console.rs
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright (c) 2024 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Element, Length,
- widget::{Scrollable, Text, button, column, row, scrollable::Id, tooltip},
-};
-
-use node_gui_backend::messages::WalletInfo;
-
-use crate::main_window::main_widget::tabs::wallet::{
- STATUS_BAR_SEPARATOR_HEIGHT, status_bar::estimate_status_bar_height,
-};
-
-use super::{ConsoleState, WalletMessage};
-
-const SUBMIT_TOOLTIP_TEXT: &str = "Submit the provided command to be processed";
-pub const CONSOLE_OUTPUT_ID: &str = "console_input_id";
-
-pub fn view_console(
- state: &ConsoleState,
- still_syncing: Option,
- wallet_info: &WalletInfo,
-) -> Element<'static, WalletMessage> {
- let s: Vec = state
- .console_inputs
- .iter()
- .zip(&state.console_outputs)
- .map(|(inp, out)| format!("> {inp}\n$ {out}"))
- .collect();
-
- let output = s.join("\n");
- // Note: it doesn't seem possible to make Scrollable fill the entire parent container,
- // e.g. passing Length::Fill for height will result in a panic:
- // "scrollable content must not fill its vertical scrolling axis".
- // So we have to use a fixed height. The value is chosen such that when the main window
- // has the initial height, the console widget fills the entire area of its parent.
- // But we also have to take the status bar into account.
- #[allow(clippy::float_arithmetic)]
- let height = {
- let status_bar_height =
- estimate_status_bar_height(&wallet_info.extra_info) + STATUS_BAR_SEPARATOR_HEIGHT;
- Length::Fixed(570.0 - status_bar_height)
- };
- let console_output = Scrollable::new(iced::widget::text(output.clone()))
- .height(height)
- .width(Length::Fill)
- .id(Id::new(CONSOLE_OUTPUT_ID));
-
- let console_input = iced::widget::text_input("command", &state.console_input)
- .on_input(WalletMessage::ConsoleInputChange)
- .on_submit(WalletMessage::ConsoleInputSubmit);
-
- let buttons = row![
- iced::widget::horizontal_space(),
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .width(Length::Shrink)
- .on_press(WalletMessage::CopyToClipboard(output)),
- button(
- Text::new(iced_fonts::Bootstrap::Trash.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .width(Length::Shrink)
- .on_press(WalletMessage::ConsoleClear),
- ]
- .width(Length::Fill)
- .align_y(iced::Alignment::End);
-
- column![
- buttons,
- console_output,
- row![
- console_input,
- iced::widget::button(Text::new("Submit"))
- .on_press(still_syncing.unwrap_or(WalletMessage::ConsoleInputSubmit)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- SUBMIT_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- ]
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs b/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs
deleted file mode 100644
index 57e6a1e254..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/delegation.rs
+++ /dev/null
@@ -1,347 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::collections::BTreeMap;
-
-use iced::{
- Element, Length,
- widget::{Space, Text, button, column, row, text_input, tooltip, tooltip::Position},
-};
-use iced_aw::{Grid, GridRow};
-
-use common::{
- address::Address,
- chain::{ChainConfig, DelegationId},
- primitives::DecimalAmount,
-};
-use node_gui_backend::messages::AccountInfo;
-
-use crate::main_window::print_coin_amount;
-
-use super::{WalletMessage, stake::MATURITY_PERIOD_TOOLTIP_TEXT};
-
-const POOL_ID_TOOLTIP_TEXT: &str =
- "The pool address of the pool that will get the delegation and stake the coins.";
-const DELEGATION_ADDRESS_TOOLTIP_TEXT: &str =
- "The address, that will have the authority to sign withdrawals from the delegation.";
-
-const SEND_DELEGATION_ADDRESS_TOOLTIP_TEXT: &str = "The address that will be receiving the coins";
-const SEND_DELEGATION_AMOUNT_TOOLTIP_TEXT: &str =
- "The amount that will be taken away from the delegation";
-const SEND_DELEGATION_ID_TOOLTIP_TEXT: &str =
- "The delegation id, from which the delegated coins will be taken";
-
-const CREATE_DELEGATION_BUTTON_TOOLTIP_TEXT: &str = "Before delegating your coins, you create an account that you own, which you can fund with coins (and withdraw from). \
- Once this is created, you can delegate coins to it for staking. If the pool is decommissioned, it is your responsibility to withdraw the coins and move them to another pool.";
-
-const WITHDRAW_BUTTON_TOOLTIP_TEXT: &str = "Withdrawing coins from delegation means they won't be staked anymore. The coins will be locked for the maturity period before they can be normally used.";
-
-#[allow(clippy::too_many_arguments)]
-pub fn view_delegation(
- chain_config: &ChainConfig,
- account: &AccountInfo,
- pool_id: &str,
- delegation_address: &str,
- send_delegation_address: &str,
- send_delegation_amount: &str,
- send_delegation_id: &str,
- delegate_staking_amounts: &BTreeMap,
- still_syncing: Option,
-) -> Element<'static, WalletMessage> {
- let delegation_balance_grid = {
- let field_padding = 5;
- // Default horizontal padding used by Button.
- let button_horizontal_padding = 10;
- let field = |text: String| iced::widget::container(Text::new(text)).padding(field_padding);
-
- // Note: due to how the items are arranged in each row (and due to their lack of borders),
- // the visual spacing between columns will be `field_padding + button_horizontal_padding`.
-
- // We print the table only if there are delegations
- if account.delegations_balance.is_empty() {
- Grid::new().push(
- GridRow::new()
- .push(field("No delegations found".to_owned()))
- .push(field(String::new())),
- )
- } else {
- let mut delegation_balance_grid =
- Grid::new().width(Length::Shrink).column_width(Length::Shrink).push(
- GridRow::new()
- .push(field("Delegation Address".to_owned()))
- .push(field("Pool Address".to_owned()))
- .push(field("Delegation balance".to_owned()))
- .push(field("".to_owned()))
- .push(field("".to_owned())),
- );
- for (delegation_id, pool_id, balance) in account
- .delegations_balance
- .iter()
- .map(|(del_id, (pool_id, b))| (*del_id, *pool_id, *b))
- {
- let delegation_address = Address::new(chain_config, delegation_id)
- .expect("Encoding delegation id to address can't fail (GUI)");
- let pool_address = Address::new(chain_config, pool_id)
- .expect("Encoding pool id to address can't fail (GUI)");
- let delegate_staking_amount =
- delegate_staking_amounts.get(&delegation_id).cloned().unwrap_or(String::new());
- delegation_balance_grid = delegation_balance_grid.push(
- GridRow::new()
- .push(row![
- tooltip(
- iced::widget::container(
- Text::new(delegation_address.to_short_string()).font(
- iced::font::Font {
- family: iced::font::Family::Monospace,
- weight: Default::default(),
- stretch: Default::default(),
- style: iced::font::Style::Normal,
- }
- )
- )
- .padding(field_padding),
- Text::new(delegation_address.to_string()),
- Position::Bottom,
- )
- .gap(5)
- .style(iced::widget::container::bordered_box),
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .width(Length::Shrink)
- .on_press(WalletMessage::CopyToClipboard(
- delegation_address.to_string(),
- )),
- ])
- .push(row![
- tooltip(
- iced::widget::container(
- Text::new(pool_address.to_short_string()).font(
- iced::font::Font {
- family: iced::font::Family::Monospace,
- weight: Default::default(),
- stretch: Default::default(),
- style: iced::font::Style::Normal,
- }
- )
- )
- .padding(field_padding),
- Text::new(pool_address.to_string()),
- Position::Bottom,
- )
- .gap(5)
- .style(iced::widget::container::bordered_box),
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .width(Length::Shrink)
- .on_press(WalletMessage::CopyToClipboard(pool_address.to_string())),
- ])
- .push(field(print_coin_amount(chain_config, balance)))
- .push(Space::new(
- Length::Fixed(button_horizontal_padding as f32),
- Length::Shrink,
- ))
- .push(
- text_input("Amount", &delegate_staking_amount)
- .on_input(move |value| {
- if value.parse::().is_ok() || value.is_empty() {
- WalletMessage::DelegationAmountEdit((delegation_id, value))
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(field_padding)
- .width(Length::Fixed(100.)),
- )
- .push(Space::new(
- Length::Fixed((field_padding + button_horizontal_padding) as f32),
- Length::Shrink,
- ))
- .push(
- button(Text::new("Delegate")).on_press(
- still_syncing
- .clone()
- .unwrap_or(WalletMessage::DelegateStaking(delegation_id)),
- ),
- ),
- );
- }
- delegation_balance_grid
- }
- };
-
- let maturity_period = chain_config
- .staking_pool_spend_maturity_block_count(
- // Assume that at the last checkpoint we already had the latest value for the maturity
- // period.
- // Note: this value has only been upgraded once on testnet (where we initially had a
- // 2000 block maturity period).
- // TODO: it's probably better to pass the actual tip height here anyway.
- chain_config.height_checkpoints().last_checkpoint().0,
- )
- .to_int();
- let maturity_period_text = format!(
- "Maturity period: {maturity_period} blocks (a block takes on average {} seconds)",
- chain_config.target_block_spacing().as_secs()
- );
-
- column![
- row![
- Text::new(maturity_period_text).size(13),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- MATURITY_PERIOD_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- // ----- Create delegation
- row![
- text_input("Pool address for new delegation", pool_id)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::DelegationPoolIdEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(10),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- POOL_ID_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- text_input("Delegation address", delegation_address)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::DelegationAddressEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(10),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- DELEGATION_ADDRESS_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- iced::widget::button(Text::new("Create delegation"))
- .padding(10)
- .on_press(still_syncing.clone().unwrap_or(WalletMessage::CreateDelegation)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- CREATE_DELEGATION_BUTTON_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- iced::widget::horizontal_rule(10),
- // ----- Send delegation to address
- row![
- text_input("Address", send_delegation_address)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::SendDelegationAddressEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(10),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- SEND_DELEGATION_ADDRESS_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- text_input("Amount to send", send_delegation_amount)
- .on_input(|value| {
- if value.parse::().is_ok() || value.is_empty() {
- WalletMessage::SendDelegationAmountEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(10),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- SEND_DELEGATION_AMOUNT_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- text_input("Delegation address", send_delegation_id)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::SendDelegationIdEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(10),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- SEND_DELEGATION_ID_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- iced::widget::button(Text::new("Withdraw from delegation"))
- .padding(10)
- .on_press(still_syncing.unwrap_or(WalletMessage::SendDelegationToAddress)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- WITHDRAW_BUTTON_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- iced::widget::horizontal_rule(10),
- // ----- Delegation balance grid
- delegation_balance_grid,
- ]
- .spacing(10)
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs b/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs
deleted file mode 100644
index 3a5fd75b10..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/left_panel.rs
+++ /dev/null
@@ -1,288 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Alignment, Element, Length,
- widget::{Column, Text, button, column, pick_list, progress_bar, row, text, tooltip},
-};
-
-use node_gui_backend::{AccountId, messages::WalletInfo};
-use wallet_types::wallet_type::WalletType;
-
-use crate::main_window::NodeState;
-
-use super::{SelectedPanel, WalletMessage};
-
-const TRANSACTIONS_TOOLTIP_TEXT: &str =
- "List of all transactions related to this account in the wallet.";
-const ADDRESSES_TOOLTIP_TEXT: &str = "List all the addresses generated in this account in the wallet. \
- Addresses can be used for various purposes, such as destinations for coins sent to you, and also as an indicator to who is allowed to decommission a staking pool.";
-const SEND_TOOLTIP_TEXT: &str = "Send coins to another address.";
-const STAKING_TOOLTIP_TEXT: &str = "Staking is the process of assisting the network in generating blocks. \
- If you have the minimum amount of required coins for staking, you can participate by creating a pool, staking, \
- and earn rewards for it. Your node will be required to be left running.";
-const DELEGATION_TOOLTIP_TEXT: &str = "Delegation is part of staking, where if you do not own the minimum required amount to stake, \
- you can delegate your coins to a pool to do the staking for you. The staking pool earns a cut of your rewards, \
- and you won't have to keep your node running.";
-const CONSOLE_TOOLTIP_TEXT: &str = "Console for using low-level functions of the wallet.";
-
-const NEW_ACCOUNT_TOOLTIP_TEXT: &str = "Accounts provide a way to completely separate keys and operations. \
- For example, you can have an account for personal use, and an account for work. \
- Each account will have a completely different set of keys.";
-
-#[derive(Clone, PartialEq, Eq)]
-struct AccountPickItem {
- account_id: AccountId,
- name: String,
-}
-
-impl std::fmt::Display for AccountPickItem {
- fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
- std::fmt::Display::fmt(&self.name, f)
- }
-}
-
-#[allow(clippy::float_arithmetic)]
-fn wallet_scan_progress(node_block_height: u64, wallet_block_height: u64) -> f32 {
- 100.0 * wallet_block_height.min(node_block_height) as f32 / node_block_height.max(1) as f32
-}
-
-pub fn view_left_panel(
- node_state: &NodeState,
- wallet_info: &WalletInfo,
- selected_account: AccountId,
- selected_panel: SelectedPanel,
-) -> Element<'static, WalletMessage> {
- let file_name = wallet_info.path.file_name().map_or_else(
- || "".to_owned(),
- |file_name| file_name.to_string_lossy().to_string(),
- );
-
- let account_items = wallet_info
- .accounts
- .iter()
- .map(|(account_id, account)| AccountPickItem {
- name: account
- .name
- .clone()
- .unwrap_or_else(|| format!("Account {}", account_id.account_index())),
- account_id: *account_id,
- })
- .collect::>();
-
- let selected_account = account_items
- .iter()
- .find(|account_item| account_item.account_id == selected_account)
- .cloned();
- let pick_list = pick_list(account_items, selected_account, |item| {
- WalletMessage::SelectAccount(item.account_id)
- });
-
- let panel_button_row_padding = 8;
- // The pick-list row looks a bit nicer when these values are equal.
- let pick_list_row_spacing = panel_button_row_padding;
-
- let panel_button = |label, panel, selected_panel, tooltip_text| {
- let label = row![
- text(label).size(16).width(Length::Fill),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- tooltip_text,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box)
- ];
-
- button(label)
- .style(if panel == selected_panel {
- iced::widget::button::primary
- } else {
- iced::widget::button::text
- })
- .width(Length::Fill)
- .on_press(WalletMessage::SelectPanel(panel))
- .padding(panel_button_row_padding)
- };
- let is_cold_wallet = wallet_info.wallet_type == WalletType::Cold;
-
- // `next_height` is used to prevent flickering when a new block is found
- let show_scan_progress = if is_cold_wallet {
- false
- } else {
- wallet_info.best_block.1.next_height() < node_state.chain_info.best_block_height
- };
-
- #[cfg(any(feature = "trezor", feature = "ledger"))]
- let hardware_wallet_panels = || {
- column![
- panel_button(
- "Transactions",
- SelectedPanel::Transactions,
- selected_panel,
- TRANSACTIONS_TOOLTIP_TEXT
- ),
- panel_button(
- "Addresses",
- SelectedPanel::Addresses,
- selected_panel,
- ADDRESSES_TOOLTIP_TEXT
- ),
- panel_button(
- "Send",
- SelectedPanel::Send,
- selected_panel,
- SEND_TOOLTIP_TEXT
- ),
- panel_button(
- "Delegation",
- SelectedPanel::Delegation,
- selected_panel,
- DELEGATION_TOOLTIP_TEXT
- ),
- panel_button(
- "Console",
- SelectedPanel::Console,
- selected_panel,
- CONSOLE_TOOLTIP_TEXT,
- )
- ]
- };
-
- let scan_progress_widget = if show_scan_progress {
- // TODO: Fix scan progress when the node is in the initial block download state
- let scan_progress = wallet_scan_progress(
- node_state.chain_info.best_block_height.into_int(),
- wallet_info.best_block.1.into_int(),
- );
- let scan_progress_str = format!(
- "{:.0}%\n({}/{} blocks)",
- scan_progress,
- wallet_info.best_block.1.into_int(),
- node_state.chain_info.best_block_height.into_int()
- );
- column![
- text(scan_progress_str)
- .align_x(iced::alignment::Horizontal::Center)
- .width(Length::Fill)
- .height(Length::Shrink),
- progress_bar(0.0..=100.0, scan_progress).width(Length::Fill),
- ]
- .padding(10)
- .spacing(10)
- .align_x(Alignment::End)
- .width(Length::Fill)
- .height(Length::Shrink)
- } else {
- Column::new()
- };
-
- column![
- column![
- text(file_name).size(25),
- row![
- pick_list.width(Length::Fill),
- button(Text::new("+"))
- .style(iced::widget::button::success)
- .on_press(WalletMessage::NewAccount),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- NEW_ACCOUNT_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box)
- ]
- .align_y(Alignment::Center)
- .spacing(pick_list_row_spacing)
- .width(Length::Fill)
- ]
- .spacing(10)
- // Note: this specifies both vertical and horizontal padding; so if this value is different
- // from the one used in `panel_button`, the tooltip's question mark will be misaligned with
- // `panel_button's question marks.
- .padding(panel_button_row_padding),
- match wallet_info.wallet_type {
- #[cfg(feature = "trezor")]
- WalletType::Trezor => {
- hardware_wallet_panels()
- }
- #[cfg(feature = "ledger")]
- WalletType::Ledger => {
- hardware_wallet_panels()
- }
- WalletType::Cold => {
- column![
- panel_button(
- "Addresses",
- SelectedPanel::Addresses,
- selected_panel,
- ADDRESSES_TOOLTIP_TEXT
- ),
- panel_button(
- "Console",
- SelectedPanel::Console,
- selected_panel,
- CONSOLE_TOOLTIP_TEXT,
- )
- ]
- }
- WalletType::Hot => column![
- panel_button(
- "Transactions",
- SelectedPanel::Transactions,
- selected_panel,
- TRANSACTIONS_TOOLTIP_TEXT
- ),
- panel_button(
- "Addresses",
- SelectedPanel::Addresses,
- selected_panel,
- ADDRESSES_TOOLTIP_TEXT
- ),
- panel_button(
- "Send",
- SelectedPanel::Send,
- selected_panel,
- SEND_TOOLTIP_TEXT
- ),
- panel_button(
- "Staking",
- SelectedPanel::Staking,
- selected_panel,
- STAKING_TOOLTIP_TEXT
- ),
- panel_button(
- "Delegation",
- SelectedPanel::Delegation,
- selected_panel,
- DELEGATION_TOOLTIP_TEXT
- ),
- panel_button(
- "Console",
- SelectedPanel::Console,
- selected_panel,
- CONSOLE_TOOLTIP_TEXT,
- )
- ],
- },
- Column::new().height(Length::Fill),
- scan_progress_widget,
- ]
- .height(Length::Fill)
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/mod.rs b/node-gui/src/main_window/main_widget/tabs/wallet/mod.rs
deleted file mode 100644
index d198dc9f02..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/mod.rs
+++ /dev/null
@@ -1,594 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-mod addresses;
-mod delegation;
-mod left_panel;
-mod send;
-mod stake;
-mod status_bar;
-mod top_panel;
-mod transactions;
-
-mod console;
-pub use console::CONSOLE_OUTPUT_ID;
-
-use std::collections::BTreeMap;
-
-use iced::{
- Element, Length, Task,
- widget::{
- PaneGrid, Scrollable, Text, column, container, horizontal_rule, pane_grid, row,
- scrollable::{Id, snap_to},
- vertical_rule,
- },
-};
-use iced_aw::tab_bar::TabLabel;
-
-use common::chain::DelegationId;
-use node_gui_backend::{
- AccountId, BackendSender,
- messages::{
- BackendRequest, CreateDelegationRequest, DecommissionPoolRequest, DelegateStakingRequest,
- SendDelegateToAddressRequest, SendRequest, StakeRequest, WalletId,
- },
-};
-use wallet_controller::DEFAULT_ACCOUNT_INDEX;
-use wallet_types::wallet_type::WalletType;
-
-use crate::main_window::NodeState;
-
-use super::{Tab, TabsMessage};
-
-pub const STATUS_BAR_SEPARATOR_HEIGHT: f32 = 1.0;
-
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub enum SelectedPanel {
- Transactions,
- Addresses,
- Send,
- Staking,
- Delegation,
- Console,
-}
-
-#[derive(Debug, Clone)]
-pub enum WalletMessage {
- CopyToClipboard(String),
-
- SelectPanel(SelectedPanel),
- Resized(pane_grid::ResizeEvent),
-
- SetPassword,
- RemovePassword,
- Lock,
- Unlock,
-
- NewAccount,
- SelectAccount(AccountId),
-
- GetNewAddress,
-
- SendAmountEdit(String),
- SendAddressEdit(String),
- Send,
- SendSucceed,
-
- StakeAmountEdit(String),
- MarginPerThousandEdit(String),
- CostPerBlockEdit(String),
- DecommissionAddressEdit(String),
- CreateStakingPool,
- CreateStakingPoolSucceed,
-
- DecommissionPoolIdEdit(String),
- DecommissionPoolAddressEdit(String),
- DecommissionPool,
- DecommissionPoolSucceed,
-
- DelegationPoolIdEdit(String),
- DelegationAddressEdit(String),
- CreateDelegation,
- CreateDelegationSucceed,
- SendDelegationAddressEdit(String),
- SendDelegationAmountEdit(String),
- SendDelegationIdEdit(String),
- SendDelegationToAddress,
- SendDelegationToAddressSucceed,
- DelegateStaking(DelegationId),
- DelegationAmountEdit((DelegationId, String)),
- DelegateStakingSucceed(DelegationId),
-
- ToggleStaking(bool),
-
- TransactionList { skip: usize },
-
- ConsoleInputChange(String),
- ConsoleInputSubmit,
- ConsoleOutput(String),
- ConsoleClear,
-
- StillSyncing,
- Close,
- NoOp,
-}
-
-#[derive(Debug, Clone, Default)]
-pub struct ConsoleState {
- pub console_inputs: Vec,
- pub console_outputs: Vec,
- pub console_input: String,
-}
-
-/// State that should be reset after changing the selected account
-#[derive(Default)]
-pub struct AccountState {
- send_amount: String,
- send_address: String,
- stake_amount: String,
- margin_per_thousand: String,
- cost_per_block_amount: String,
- decommission_address: String,
-
- decommission_pool_address: String,
- decommission_pool_id: String,
-
- delegation_pool_id: String,
- delegation_address: String,
- delegate_staking_amounts: BTreeMap,
-
- send_delegation_address: String,
- send_delegation_amount: String,
- send_delegation_id: String,
-
- console_state: ConsoleState,
-}
-
-pub struct WalletTab {
- wallet_id: WalletId,
- selected_account: AccountId,
- selected_panel: SelectedPanel,
- account_state: AccountState,
- panes: pane_grid::State,
-}
-
-enum WalletPane {
- Left,
- Right,
-}
-
-impl WalletTab {
- pub fn new(wallet_id: WalletId, wallet_type: WalletType) -> Self {
- let (mut panes, pane) = pane_grid::State::new(WalletPane::Left);
-
- let (_pane, split) = panes
- .split(pane_grid::Axis::Vertical, pane, WalletPane::Right)
- .expect("split should not fail");
- panes.resize(split, 0.2);
-
- let selected_panel = match wallet_type {
- WalletType::Hot => SelectedPanel::Transactions,
- WalletType::Cold => SelectedPanel::Addresses,
- #[cfg(feature = "trezor")]
- WalletType::Trezor => SelectedPanel::Transactions,
- #[cfg(feature = "ledger")]
- WalletType::Ledger => SelectedPanel::Transactions,
- };
-
- WalletTab {
- wallet_id,
- selected_account: AccountId::new(DEFAULT_ACCOUNT_INDEX),
- selected_panel,
- account_state: AccountState::default(),
- panes,
- }
- }
-
- pub fn wallet_id(&self) -> WalletId {
- self.wallet_id
- }
-
- pub fn update(
- &mut self,
- message: WalletMessage,
- backend_sender: &BackendSender,
- ) -> Task {
- match message {
- WalletMessage::CopyToClipboard(text) => {
- // TODO: Show toast notification
- iced::clipboard::write(text)
- }
-
- WalletMessage::SelectPanel(selected_panel) => {
- self.selected_panel = selected_panel;
- if self.selected_panel == SelectedPanel::Console {
- snap_to(
- Id::new(CONSOLE_OUTPUT_ID),
- iced::widget::scrollable::RelativeOffset { x: 0.0, y: 1.0 },
- )
- } else {
- Task::none()
- }
- }
-
- WalletMessage::Resized(pane_grid::ResizeEvent { split, ratio }) => {
- self.panes.resize(split, ratio);
- Task::none()
- }
-
- WalletMessage::SetPassword
- | WalletMessage::RemovePassword
- | WalletMessage::Lock
- | WalletMessage::Unlock
- | WalletMessage::NewAccount => {
- // Processed by the main_window
- Task::none()
- }
-
- WalletMessage::SelectAccount(account_id) => {
- if account_id != self.selected_account {
- self.selected_account = account_id;
- self.account_state = AccountState::default();
- }
- Task::none()
- }
-
- WalletMessage::GetNewAddress => {
- backend_sender.send(BackendRequest::NewAddress(
- self.wallet_id,
- self.selected_account,
- ));
- Task::none()
- }
- WalletMessage::SendAmountEdit(value) => {
- self.account_state.send_amount = value;
- Task::none()
- }
- WalletMessage::SendAddressEdit(value) => {
- self.account_state.send_address = value;
- Task::none()
- }
- WalletMessage::Send => {
- let request = SendRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- address: self.account_state.send_address.clone(),
- amount: self.account_state.send_amount.clone(),
- };
- backend_sender.send(BackendRequest::SendAmount(request));
- Task::none()
- }
- WalletMessage::SendSucceed => {
- self.account_state.send_address.clear();
- self.account_state.send_amount.clear();
- Task::none()
- }
- WalletMessage::StakeAmountEdit(value) => {
- self.account_state.stake_amount = value;
- Task::none()
- }
- WalletMessage::MarginPerThousandEdit(value) => {
- self.account_state.margin_per_thousand = value;
- Task::none()
- }
- WalletMessage::CostPerBlockEdit(value) => {
- self.account_state.cost_per_block_amount = value;
- Task::none()
- }
- WalletMessage::DecommissionAddressEdit(value) => {
- self.account_state.decommission_address = value;
- Task::none()
- }
- WalletMessage::DecommissionPoolIdEdit(value) => {
- self.account_state.decommission_pool_id = value;
- Task::none()
- }
- WalletMessage::DecommissionPoolAddressEdit(value) => {
- self.account_state.decommission_pool_address = value;
- Task::none()
- }
-
- WalletMessage::CreateStakingPool => {
- let request = StakeRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- pledge_amount: self.account_state.stake_amount.clone(),
- mpt: self.account_state.margin_per_thousand.clone(),
- cost_per_block: self.account_state.cost_per_block_amount.clone(),
- decommission_address: self.account_state.decommission_address.clone(),
- };
- backend_sender.send(BackendRequest::StakeAmount(request));
- Task::none()
- }
- WalletMessage::CreateStakingPoolSucceed => {
- self.account_state.stake_amount.clear();
- self.account_state.margin_per_thousand.clear();
- self.account_state.cost_per_block_amount.clear();
- self.account_state.decommission_address.clear();
- Task::none()
- }
- WalletMessage::DecommissionPool => {
- let request = DecommissionPoolRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- pool_id: self.account_state.decommission_pool_id.clone(),
- output_address: self.account_state.decommission_pool_address.clone(),
- };
- backend_sender.send(BackendRequest::DecommissionPool(request));
- Task::none()
- }
- WalletMessage::DecommissionPoolSucceed => {
- self.account_state.decommission_pool_id.clear();
- self.account_state.decommission_pool_address.clear();
- Task::none()
- }
- WalletMessage::ToggleStaking(enabled) => {
- backend_sender.send(BackendRequest::ToggleStaking(
- self.wallet_id,
- self.selected_account,
- enabled,
- ));
- Task::none()
- }
- WalletMessage::TransactionList { skip } => {
- backend_sender.send(BackendRequest::TransactionList {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- skip,
- });
- Task::none()
- }
- WalletMessage::ConsoleInputChange(new_state) => {
- self.account_state.console_state.console_input = new_state;
- Task::none()
- }
- WalletMessage::ConsoleInputSubmit => {
- self.account_state
- .console_state
- .console_inputs
- .push(self.account_state.console_state.console_input.clone());
- backend_sender.send(BackendRequest::ConsoleCommand {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- command: std::mem::take(&mut self.account_state.console_state.console_input),
- });
- Task::none()
- }
- WalletMessage::ConsoleClear => {
- self.account_state.console_state.console_outputs.clear();
- self.account_state.console_state.console_inputs.clear();
-
- Task::none()
- }
- WalletMessage::ConsoleOutput(output) => {
- self.account_state.console_state.console_outputs.push(output);
-
- snap_to(
- Id::new(CONSOLE_OUTPUT_ID),
- iced::widget::scrollable::RelativeOffset { x: 0.0, y: 1.0 },
- )
- }
- WalletMessage::StillSyncing => Task::none(),
- WalletMessage::Close => {
- backend_sender.send(BackendRequest::CloseWallet(self.wallet_id));
- Task::none()
- }
- WalletMessage::DelegationPoolIdEdit(value) => {
- self.account_state.delegation_pool_id = value;
- Task::none()
- }
- WalletMessage::DelegationAddressEdit(value) => {
- self.account_state.delegation_address = value;
- Task::none()
- }
- WalletMessage::CreateDelegation => {
- let request = CreateDelegationRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- pool_id: self.account_state.delegation_pool_id.clone(),
- delegation_address: self.account_state.delegation_address.clone(),
- };
- backend_sender.send(BackendRequest::CreateDelegation(request));
- Task::none()
- }
- WalletMessage::CreateDelegationSucceed => {
- self.account_state.delegation_pool_id.clear();
- self.account_state.delegation_address.clear();
- Task::none()
- }
- WalletMessage::DelegateStaking(delegation_id) => {
- let request = DelegateStakingRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- delegation_id,
- delegation_amount: self
- .account_state
- .delegate_staking_amounts
- .get(&delegation_id)
- .cloned()
- .unwrap_or(String::new()),
- };
- backend_sender.send(BackendRequest::DelegateStaking(request));
- Task::none()
- }
- WalletMessage::DelegationAmountEdit((delegation_id, amount)) => {
- self.account_state.delegate_staking_amounts.insert(delegation_id, amount);
- Task::none()
- }
- WalletMessage::DelegateStakingSucceed(delegation_id) => {
- self.account_state.delegate_staking_amounts.remove(&delegation_id);
- Task::none()
- }
- WalletMessage::SendDelegationAddressEdit(value) => {
- self.account_state.send_delegation_address = value;
- Task::none()
- }
- WalletMessage::SendDelegationAmountEdit(value) => {
- self.account_state.send_delegation_amount = value;
- Task::none()
- }
- WalletMessage::SendDelegationIdEdit(value) => {
- self.account_state.send_delegation_id = value;
- Task::none()
- }
- WalletMessage::SendDelegationToAddress => {
- let request = SendDelegateToAddressRequest {
- wallet_id: self.wallet_id,
- account_id: self.selected_account,
- address: self.account_state.send_delegation_address.clone(),
- amount: self.account_state.send_delegation_amount.clone(),
- delegation_id: self.account_state.send_delegation_id.clone(),
- };
- backend_sender.send(BackendRequest::SendDelegationToAddress(request));
- Task::none()
- }
- WalletMessage::SendDelegationToAddressSucceed => {
- self.account_state.send_delegation_address.clear();
- self.account_state.send_delegation_amount.clear();
- self.account_state.send_delegation_id.clear();
- Task::none()
- }
- WalletMessage::NoOp => Task::none(),
- }
- }
-}
-
-impl Tab for WalletTab {
- type Message = TabsMessage;
-
- fn tab_label(&self, node_state: &NodeState) -> TabLabel {
- let text = match node_state.wallets.get(&self.wallet_id) {
- Some(wallet_info) => match wallet_info.extra_info {
- wallet_controller::types::WalletExtraInfo::SoftwareWallet => "Software wallet",
- #[cfg(feature = "trezor")]
- wallet_controller::types::WalletExtraInfo::TrezorWallet { .. } => "Trezor wallet",
- #[cfg(feature = "ledger")]
- wallet_controller::types::WalletExtraInfo::LedgerWallet { .. } => "Ledger wallet",
- },
- None => "No wallet",
- };
-
- TabLabel::IconText(iced_fonts::Bootstrap::Wallet.into(), text.to_owned())
- }
-
- fn content(&self, node_state: &NodeState) -> Element<'_, Self::Message> {
- let wallet_info = match node_state.wallets.get(&self.wallet_id) {
- Some(wallet_info) => wallet_info,
- None => return Text::new("No wallet").into(),
- };
-
- let account = wallet_info
- .accounts
- .get(&self.selected_account)
- .expect("selected account must be known");
-
- let is_cold_wallet = wallet_info.wallet_type == WalletType::Cold;
-
- let still_syncing = if is_cold_wallet {
- false
- } else {
- wallet_info.best_block.1.next_height() < node_state.chain_info.best_block_height
- }
- .then_some(WalletMessage::StillSyncing);
-
- // PaneGrid is used to make the left panel resizable
- let pane_grid: Element =
- PaneGrid::new(&self.panes, move |_id, pane, _is_maximized| match pane {
- WalletPane::Left => {
- let left_panel = left_panel::view_left_panel(
- node_state,
- wallet_info,
- self.selected_account,
- self.selected_panel,
- );
-
- pane_grid::Content::new(row![left_panel, vertical_rule(1)])
- }
- WalletPane::Right => {
- let body = match self.selected_panel {
- SelectedPanel::Transactions => {
- transactions::view_transactions(&node_state.chain_config, account)
- }
- SelectedPanel::Addresses => {
- addresses::view_addresses(account, still_syncing.clone())
- }
- SelectedPanel::Send => send::view_send(
- &self.account_state.send_address,
- &self.account_state.send_amount,
- still_syncing.clone(),
- ),
- SelectedPanel::Staking => stake::view_stake(
- &node_state.chain_config,
- account,
- &self.account_state.stake_amount,
- &self.account_state.margin_per_thousand,
- &self.account_state.cost_per_block_amount,
- &self.account_state.decommission_address,
- &self.account_state.decommission_pool_id,
- &self.account_state.decommission_pool_address,
- still_syncing.clone(),
- ),
- SelectedPanel::Delegation => delegation::view_delegation(
- &node_state.chain_config,
- account,
- &self.account_state.delegation_pool_id,
- &self.account_state.delegation_address,
- &self.account_state.send_delegation_address,
- &self.account_state.send_delegation_amount,
- &self.account_state.send_delegation_id,
- &self.account_state.delegate_staking_amounts,
- still_syncing.clone(),
- ),
- SelectedPanel::Console => console::view_console(
- &self.account_state.console_state,
- still_syncing.clone(),
- wallet_info,
- ),
- };
-
- let body = Scrollable::new(container(body).padding(10))
- .width(Length::Fill)
- .height(Length::Fill);
-
- let top_panel = container(top_panel::view_top_panel(
- &node_state.chain_config,
- wallet_info,
- account,
- ))
- .height(50)
- .width(Length::Fill);
-
- pane_grid::Content::new(column![top_panel, horizontal_rule(1.0), body])
- }
- })
- .width(Length::Fill)
- .height(Length::Fill)
- .on_resize(10, WalletMessage::Resized)
- .into();
-
- let result = if let Some(status_bar) = status_bar::view_status_bar(&wallet_info.extra_info)
- {
- Element::new(column![
- pane_grid,
- horizontal_rule(STATUS_BAR_SEPARATOR_HEIGHT),
- container(status_bar).width(Length::Fill)
- ])
- } else {
- pane_grid
- };
-
- result.map(|msg| TabsMessage::WalletMessage(self.wallet_id, msg))
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/send.rs b/node-gui/src/main_window/main_widget/tabs/wallet/send.rs
deleted file mode 100644
index 2cd9527cd5..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/send.rs
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use common::primitives::DecimalAmount;
-use iced::{
- Element,
- widget::{Text, column, text_input},
-};
-
-use super::WalletMessage;
-
-pub fn view_send(
- send_address: &str,
- send_amount: &str,
- still_syncing: Option,
-) -> Element<'static, WalletMessage> {
- column![
- text_input("Address", send_address)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::SendAddressEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- text_input("Amount", send_amount)
- .on_input(|value| {
- if value.parse::().is_ok() || value.is_empty() {
- WalletMessage::SendAmountEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- iced::widget::button(Text::new("Send"))
- .on_press(still_syncing.unwrap_or(WalletMessage::Send))
- ]
- .spacing(10)
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs b/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs
deleted file mode 100644
index e35f3f3b1b..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/stake.rs
+++ /dev/null
@@ -1,339 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Alignment, Element, Length,
- widget::{Text, button, column, row, text_input, tooltip, tooltip::Position},
-};
-use iced_aw::{Grid, GridRow};
-
-use common::{address::Address, chain::ChainConfig, primitives::DecimalAmount};
-use node_gui_backend::messages::AccountInfo;
-
-use crate::main_window::{print_coin_amount, print_margin_ratio};
-
-use super::WalletMessage;
-const MIN_PLEDGE_AMOUNT_TOOLTIP_TEXT: &str = "This is the minimum amount that must be pledged in a pool. \
- A pledge is an amount locked in a pool and cannot be taken out (in addition to the rewards that are earned in the pool). \
- Once a pool is decommissioned, the reward will be transferred in a locked state and will be usable after the maturity period.";
-
-pub const MATURITY_PERIOD_TOOLTIP_TEXT: &str = "Any amount in a staking pool, whether staked or delegated, can be freely transferred \
- after this period of time has passed. For pools, the maturity period must pass after decommissioning the pool to make the pledge \
- (and the rewards for that pool) reusable after being locked. \
- For delegations, any amount taken out of a delegation will be locked for the maturity period. The locking is done automatically \
- at the consensus level.";
-
-const PLEDGE_AMOUNT_TOOLTIP_TEXT: &str = "The amount to be pledged to the pool. There is a minimum to be accepted. \
- This amount, and the rewards gained by the pool, CANNOT be taken out without decommissioning the pool. \
- If you'd like to withdraw rewards, consider creating a pool and delegating to yourself. \
- Delegators have no restrictions on withdrawals. \
- The likelihood to win block rewards, by creating blocks while staking, is proportional to how much the pool owns, \
- up to a maximum, to discourage heavy centralization of power.";
-
-const COST_PER_BLOCK_TOOLTIP_TEXT: &str = "An amount in coins to be subtracted from the total rewards in a block and handed to the staker \
- as a constant/fixed cost for running the pool.";
-
-const MARGIN_PER_THOUSAND_TOOLTIP_TEXT: &str = "After subtracting \"cost per block\" from the reward, this ratio is taken from the rewards and is handed to the staker. \
- What is left is distributed among delegators, pro-rata, based on their delegation amounts. \
- The amount here is written as a percentage with per-mill accuracy. For example, 0.1% is valid, \
- and is equivalent to 0.001. Also 5% is valid and is equivalent to 0.05.";
-
-const DECOMMISSION_ADDRESS_TOOLTIP_TEXT: &str = "The key that can decommission the pool. It's recommended to keep the decommission key in a cold storage.";
-
-const CREATE_STAKING_POOL_TOOLTIP_TEXT: &str = "A staking pool locks the pledge provided, and can earn you rewards while staking, \
- by securing the network and creating blocks. You can also get other delegators to delegate coins to you, \
- which will earn you extra rewards for staking their coins. Once a pool is created, it will be assigned a pool id, which can be used \
- by other delegators to delegate to you.";
-
-const START_STAKING_TOOLTIP_TEXT: &str = "If you have created pools, this will activate staking. The node must be kept running, in order to assist the network in creating blocks and earn rewards.";
-
-const DECOMMISSION_POOL_ADDRESS_TOOLTIP_TEXT: &str = "The address of the pool that will be decommissioned. Make sure to stop staking before going through with this.";
-const DECOMMISSION_COINS_DESTINATION_ADDRESS_TOOLTIP_TEXT: &str =
- "The output address where the coins will be sent after decommissioning the pool.";
-const DECOMMISSION_POOL_TOOLTIP_TEXT: &str = "This will decommission the staking pool and lock the pledge amount for the maturity period (see above to learn how long). Locking implies that the coins cannot be moved until the lock period is over. This is needed for blockchain security reasons. Please STOP STAKING before doing this, otherwise decommissioning won't work. DO NOT use an exchange address for this. Most exchanges cannot handle locked outputs.";
-
-#[allow(clippy::too_many_arguments)]
-pub fn view_stake(
- chain_config: &ChainConfig,
- account: &AccountInfo,
- stake_amount: &str,
- mpt: &str,
- cost_per_block: &str,
- decommission_key: &str,
- decommission_pool_id: &str,
- decommission_pool_address: &str,
- still_syncing: Option,
-) -> Element<'static, WalletMessage> {
- let field = |text: String| iced::widget::container(Text::new(text)).padding(5);
-
- let staking_balance_grid = {
- // We print the table only if there are staking pools
- if account.staking_balance.is_empty() {
- Grid::new().push(
- GridRow::new()
- .push(field("No staking pools found".to_owned()))
- .push(field(String::new())),
- )
- } else {
- let mut staking_balance_grid = Grid::new().width(Length::Fill).push(
- GridRow::new()
- .push(field("Pool Address".to_owned()))
- .push(field("Margin ratio".to_owned()))
- .push(field("Cost per block".to_owned()))
- .push(field("Pool balance".to_owned())),
- );
- for (pool_id, pool_data) in account.staking_balance.iter() {
- let pool_id_address = Address::new(chain_config, *pool_id)
- .expect("Encoding pool id to address can't fail (GUI)");
- staking_balance_grid = staking_balance_grid.push(
- GridRow::new()
- .push(row!(
- tooltip(
- iced::widget::container(
- Text::new(pool_id_address.to_short_string()).font(
- iced::font::Font {
- family: iced::font::Family::Monospace,
- weight: Default::default(),
- stretch: Default::default(),
- style: iced::font::Style::Normal,
- }
- )
- )
- .padding(5),
- Text::new(pool_id_address.to_string()),
- Position::Bottom,
- )
- .gap(5)
- .style(iced::widget::container::bordered_box),
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .on_press(WalletMessage::CopyToClipboard(pool_id_address.to_string())),
- ))
- .push(field(print_margin_ratio(
- pool_data.margin_ratio_per_thousand,
- )))
- .push(field(print_coin_amount(
- chain_config,
- pool_data.cost_per_block.amount(),
- )))
- .push(field(print_coin_amount(
- chain_config,
- pool_data.balance.amount(),
- ))),
- );
- }
- staking_balance_grid
- }
- };
-
- // We only show the staking button if there's something to stake
- let staking_enabled_row = if !account.staking_balance.is_empty() {
- let (staking_status, staking_button, new_state) = if account.staking_enabled {
- ("Staking running", "Stop", false)
- } else {
- ("Staking is stopped", "Start", true)
- };
-
- row![
- Text::new(staking_status),
- iced::widget::button(Text::new(staking_button))
- .on_press(still_syncing.clone().unwrap_or(WalletMessage::ToggleStaking(new_state))),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- START_STAKING_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ]
- } else {
- row![]
- };
-
- let min_pledge_text = format!(
- "Minimum pledge to create a pool: {} {}",
- chain_config
- .min_stake_pool_pledge()
- .into_fixedpoint_str(chain_config.coin_decimals()),
- chain_config.coin_ticker()
- );
-
- let maturity_period = chain_config.staking_pool_spend_maturity_block_count(1.into()).to_int();
- let maturity_period_text = format!(
- "Maturity period: {maturity_period} blocks (a block takes on average {} seconds)",
- chain_config.target_block_spacing().as_secs()
- );
-
- column![
- row![Text::new(min_pledge_text).size(13),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- MIN_PLEDGE_AMOUNT_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![Text::new(maturity_period_text).size(13),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- MATURITY_PERIOD_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- text_input("Pledge amount for the new staking pool", stake_amount)
- .on_input(|value| {
- if value.parse::().is_ok() || value.is_empty() {
- WalletMessage::StakeAmountEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- PLEDGE_AMOUNT_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
-
- row![
- text_input("Cost per block", cost_per_block)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_digit()) {
- WalletMessage::CostPerBlockEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- COST_PER_BLOCK_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
-
- row![
- text_input("Margin ratio per thousand. The decimal must be in the range [0.001,1.000] or [0.1%,100%]", mpt)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_digit() | (ch=='.') | (ch=='%')) {
- WalletMessage::MarginPerThousandEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- MARGIN_PER_THOUSAND_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
-
- row![
- text_input("Decommission address", decommission_key)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::DecommissionAddressEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- DECOMMISSION_ADDRESS_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
-
- row![
- iced::widget::button(Text::new("Create staking pool"))
- .padding(15)
- .on_press(still_syncing.clone().unwrap_or(WalletMessage::CreateStakingPool)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- CREATE_STAKING_POOL_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
-
- staking_enabled_row.spacing(10).align_y(Alignment::Center),
- iced::widget::horizontal_rule(10),
- staking_balance_grid,
- iced::widget::horizontal_rule(10),
- row![
- text_input("Pool address to decommission", decommission_pool_id)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::DecommissionPoolIdEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- DECOMMISSION_POOL_ADDRESS_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- text_input("Address that will receive the proceeds from the staking pool", decommission_pool_address)
- .on_input(|value| {
- if value.chars().all(|ch| ch.is_ascii_alphanumeric()) {
- WalletMessage::DecommissionPoolAddressEdit(value)
- } else {
- WalletMessage::NoOp
- }
- })
- .padding(15),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- DECOMMISSION_COINS_DESTINATION_ADDRESS_TOOLTIP_TEXT,
- Position::Bottom)
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- row![
- iced::widget::button(Text::new("Decommission staking pool"))
- .style(iced::widget::button::danger)
- .padding(15)
- .on_press(still_syncing.unwrap_or(WalletMessage::DecommissionPool)),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string()).font(iced_fonts::BOOTSTRAP_FONT),
- DECOMMISSION_POOL_TOOLTIP_TEXT,
- Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- ]
- .spacing(10)
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/status_bar.rs b/node-gui/src/main_window/main_widget/tabs/wallet/status_bar.rs
deleted file mode 100644
index da75bee697..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/status_bar.rs
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::Element;
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-use iced::{
- Alignment, Font, Length, Padding, Theme, font,
- widget::{Container, Row, container, rich_text, row, span},
-};
-
-use wallet_controller::types::WalletExtraInfo;
-
-use super::WalletMessage;
-
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-const TEXT_SIZE: f32 = 16.;
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-const VERTICAL_PADDING: f32 = 5.;
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-const HORIZONTAL_PADDING: f32 = 10.;
-
-#[allow(clippy::float_arithmetic)]
-pub fn estimate_status_bar_height(wallet_info: &WalletExtraInfo) -> f32 {
- #[cfg(any(feature = "trezor", feature = "ledger"))]
- let height_for_hw_wallet = TEXT_SIZE + 2. * VERTICAL_PADDING
- // For some reason, the status bar gets a bit of additional height.
- + 4.;
-
- match wallet_info {
- WalletExtraInfo::SoftwareWallet => 0.,
- #[cfg(feature = "trezor")]
- WalletExtraInfo::TrezorWallet { .. } => height_for_hw_wallet,
- #[cfg(feature = "ledger")]
- WalletExtraInfo::LedgerWallet { .. } => height_for_hw_wallet,
- }
-}
-
-pub fn view_status_bar(wallet_info: &WalletExtraInfo) -> Option> {
- #[cfg(any(feature = "trezor", feature = "ledger"))]
- let make_status_bar = |row: Row<'static, WalletMessage>| {
- Container::new(
- row.width(Length::Fill)
- .padding(Padding {
- top: VERTICAL_PADDING,
- right: HORIZONTAL_PADDING,
- bottom: VERTICAL_PADDING,
- left: HORIZONTAL_PADDING,
- })
- .spacing(HORIZONTAL_PADDING)
- .align_y(Alignment::Center),
- )
- .style(|theme: &Theme| {
- let palette = theme.extended_palette();
-
- container::Style {
- background: Some(palette.background.weak.color.into()),
- ..container::Style::default()
- }
- })
- };
-
- #[cfg(any(feature = "trezor", feature = "ledger"))]
- let bold_font = Font {
- weight: font::Weight::Bold,
- ..Font::default()
- };
-
- match wallet_info {
- WalletExtraInfo::SoftwareWallet => None,
- #[cfg(feature = "trezor")]
- WalletExtraInfo::TrezorWallet {
- device_id: _,
- device_name,
- firmware_version,
- } => {
- let row = row![
- rich_text([span("Device name: ").font(bold_font), span(device_name.clone())])
- .size(TEXT_SIZE),
- rich_text([
- span("Firmware version: ").font(bold_font),
- span(firmware_version.clone())
- ])
- .size(TEXT_SIZE),
- ];
-
- Some(make_status_bar(row).into())
- }
- #[cfg(feature = "ledger")]
- WalletExtraInfo::LedgerWallet { app_version, model } => {
- let row = row![
- rich_text([span("Model name: ").font(bold_font), span(model.clone())])
- .size(TEXT_SIZE),
- rich_text([span("App version: ").font(bold_font), span(app_version.clone())])
- .size(TEXT_SIZE),
- ];
-
- Some(make_status_bar(row).into())
- }
- }
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs b/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs
deleted file mode 100644
index 4120450dd5..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/top_panel.rs
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Alignment, Element, Length,
- widget::{Text, button, horizontal_space, row, text::LineHeight, tooltip},
-};
-
-use common::chain::ChainConfig;
-use node_gui_backend::messages::{AccountInfo, EncryptionState, WalletInfo};
-
-use crate::main_window::print_coin_amount_with_ticker;
-
-use super::WalletMessage;
-
-const ENCRYPT_WALLET_TOOLTIP_TEXT: &str = "Encrypting the wallet will protect all the private keys and secret information in the wallet. \
- Not everything will be encrypted, but unlocking the wallet will be required to send coins, or do anything that requires private keys. \
- Encryption provides security in case your wallet file was found by someone unauthorized. Keep in mind that if you lose your password, you will absolutely \
- lose access to your wallet and the only way to recover your assets is by using the recovery phrase.";
-
-pub fn view_top_panel(
- chain_config: &ChainConfig,
- wallet_info: &WalletInfo,
- account: &AccountInfo,
-) -> Element<'static, WalletMessage> {
- let balance = account.balance.coins();
- let balance = print_coin_amount_with_ticker(chain_config, balance.amount());
- let balance = Text::new(balance).size(20);
-
- let password = match wallet_info.encryption {
- EncryptionState::EnabledLocked => {
- row![
- iced::widget::button(Text::new("Unlock").line_height(LineHeight::Relative(1.0)))
- .on_press(WalletMessage::Unlock)
- ]
- }
- EncryptionState::EnabledUnlocked => row![
- iced::widget::button(Text::new("Lock").line_height(LineHeight::Relative(1.0)))
- .on_press(WalletMessage::Lock),
- iced::widget::button(
- Text::new("Disable wallet encryption").line_height(LineHeight::Relative(1.0))
- )
- .on_press(WalletMessage::RemovePassword)
- ],
- EncryptionState::Disabled => row![
- iced::widget::button(
- Text::new("Encrypt wallet").line_height(LineHeight::Relative(1.0))
- )
- .on_press(WalletMessage::SetPassword),
- tooltip(
- Text::new(iced_fonts::Bootstrap::Question.to_string())
- .line_height(LineHeight::Relative(1.0))
- .font(iced_fonts::BOOTSTRAP_FONT),
- ENCRYPT_WALLET_TOOLTIP_TEXT,
- tooltip::Position::Bottom
- )
- .gap(10)
- .style(iced::widget::container::bordered_box),
- ],
- }
- .align_y(Alignment::Center)
- .spacing(10);
-
- row![
- balance,
- horizontal_space(),
- password,
- button(Text::new("Close wallet").line_height(LineHeight::Relative(1.0)))
- .style(iced::widget::button::danger)
- .on_press(WalletMessage::Close),
- ]
- .width(Length::Fill)
- .height(Length::Fill)
- .spacing(10)
- .padding(10)
- .align_y(Alignment::Center)
- .into()
-}
diff --git a/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs b/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs
deleted file mode 100644
index b0df9db7e9..0000000000
--- a/node-gui/src/main_window/main_widget/tabs/wallet/transactions.rs
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Alignment, Element, Length,
- widget::{Column, Text, button, row, tooltip, tooltip::Position},
-};
-use iced_aw::{Grid, GridRow};
-
-use common::chain::ChainConfig;
-use node_gui_backend::messages::AccountInfo;
-
-use crate::main_window::{print_block_timestamp, print_coin_amount};
-
-use super::WalletMessage;
-
-pub fn view_transactions(
- chain_config: &ChainConfig,
- account: &AccountInfo,
-) -> Element<'static, WalletMessage> {
- let field = |text: String| iced::widget::container(Text::new(text)).padding(5);
- let mut transactions = Column::new();
-
- let current_transaction_list = &account.transaction_list;
- let mut transaction_list = Grid::new()
- .width(Length::Fill)
- .push(
- GridRow::new()
- .push(field("#".into()))
- .push(field("Transaction Id".into()))
- .push(field("Timestamp (UTC)".into()))
- .push(field("Type".into()))
- .push(field("Amount".into()))
- .push(field("State".into())),
- )
- .column_widths(&[
- // Make the number column stretch just a little bit, compared to the other ones.
- Length::FillPortion(1),
- Length::FillPortion(5),
- Length::FillPortion(5),
- Length::FillPortion(5),
- Length::FillPortion(5),
- Length::FillPortion(5),
- ]);
- for (index, tx) in current_transaction_list.txs.iter().enumerate() {
- let amount_str = tx
- .tx_type
- .amount()
- .map(|amount| print_coin_amount(chain_config, amount))
- .unwrap_or_default();
- let timestamp = tx.timestamp.as_ref().map_or_else(
- || "-".to_owned(),
- |timestamp| print_block_timestamp(*timestamp),
- );
- let full_tx_id_str = format!("{:x}", tx.txid);
- transaction_list = transaction_list.push(
- GridRow::new()
- .push(field(format!("{}", current_transaction_list.skip + index)))
- .push(row![
- tooltip(
- iced::widget::container(Text::new(tx.txid.to_string()).font(
- iced::font::Font {
- family: iced::font::Family::Monospace,
- weight: Default::default(),
- stretch: Default::default(),
- style: iced::font::Style::Normal,
- }
- ))
- .padding(5),
- Text::new(full_tx_id_str.clone()),
- Position::Bottom,
- )
- .gap(5)
- .style(iced::widget::container::bordered_box),
- button(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .width(Length::Shrink)
- .on_press(WalletMessage::CopyToClipboard(full_tx_id_str)),
- ])
- .push(field(timestamp))
- .push(field(tx.tx_type.type_name().to_owned()))
- .push(field(amount_str))
- .push(field(tx.state.short_name().to_owned())),
- );
- }
-
- let page_index = current_transaction_list.skip / current_transaction_list.count;
- let page_count =
- current_transaction_list.total.saturating_sub(1) / current_transaction_list.count;
- let prev_enabled = page_index > 0;
- let next_enabled = page_index < page_count;
-
- let prev_button = iced::widget::button(Text::new("<<"));
- let next_button = iced::widget::button(Text::new(">>"));
-
- let prev_button = if prev_enabled {
- prev_button.on_press(WalletMessage::TransactionList {
- skip: current_transaction_list.skip.saturating_sub(current_transaction_list.count),
- })
- } else {
- prev_button
- };
- let next_button = if next_enabled {
- next_button.on_press(WalletMessage::TransactionList {
- skip: current_transaction_list.skip.saturating_add(current_transaction_list.count),
- })
- } else {
- next_button
- };
-
- let transaction_list_controls =
- row![prev_button, Text::new(format!("{}/{}", page_index, page_count)), next_button,]
- .spacing(10)
- .align_y(Alignment::Center);
- transactions = transactions.push(transaction_list).push(transaction_list_controls);
-
- transactions.into()
-}
diff --git a/node-gui/src/main_window/mod.rs b/node-gui/src/main_window/mod.rs
deleted file mode 100644
index f08be98f52..0000000000
--- a/node-gui/src/main_window/mod.rs
+++ /dev/null
@@ -1,1069 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::{collections::BTreeMap, convert::identity, path::PathBuf, sync::Arc, time::Duration};
-
-use chainstate::ChainInfo;
-use common::{
- chain::{ChainConfig, block::timestamp::BlockTimestamp},
- primitives::{Amount, per_thousand::PerThousand, semver::SemVer, user_agent::UserAgent},
-};
-use iced::{
- Element, Length, Task,
- widget::{Stack, Text, center, container},
-};
-use logging::log;
-use networking::types::ConnectionDirection;
-use node_gui_backend::{
- BackendSender, InitializedNode,
- messages::{
- BackendEvent, BackendRequest, EncryptionAction, SignedTransactionWrapper, TransactionInfo,
- WalletId, WalletInfo,
- },
-};
-use p2p::{P2pEvent, net::types::services::Services, types::peer_id::PeerId};
-use rfd::AsyncFileDialog;
-use wallet_cli_commands::ConsoleCommand;
-use wallet_controller::types::WalletTypeArgs;
-use wallet_types::{ImportOrCreate, seed_phrase::StoreSeedPhrase, wallet_type::WalletType};
-
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-use crate::widgets::create_hw_wallet::HardwareWalletType;
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-use crate::widgets::create_hw_wallet::hw_wallet_create_dialog;
-use crate::{
- WalletMode,
- main_window::{main_menu::MenuMessage, main_widget::MainWidgetMessage},
- widgets::{
- confirm_broadcast::new_confirm_broadcast,
- esc_handler::esc_handler,
- new_wallet_account::new_wallet_account,
- opaque::opaque,
- popup_dialog::{Popup, popup_dialog},
- wallet_mnemonic::wallet_mnemonic_dialog,
- wallet_set_password::wallet_set_password_dialog,
- wallet_unlock::wallet_unlock_dialog,
- },
-};
-
-use self::main_widget::tabs::{TabsMessage, wallet::WalletMessage};
-
-mod main_menu;
-mod main_widget;
-
-#[derive(Debug, PartialEq, Eq)]
-enum ActiveDialog {
- None,
- WalletCreate { wallet_args: WalletArgs },
- WalletRecover { wallet_type: WalletType },
- WalletSetPassword { wallet_id: WalletId },
- WalletUnlock { wallet_id: WalletId },
- NewAccount { wallet_id: WalletId },
- ConfirmTransaction { transaction_info: TransactionInfo },
-}
-
-#[derive(Debug)]
-pub struct NodeState {
- chain_config: Arc,
- chain_info: ChainInfo,
- connected_peers: BTreeMap,
- wallets: BTreeMap,
-}
-
-impl NodeState {
- pub fn chain_config(&self) -> &ChainConfig {
- &self.chain_config
- }
-}
-
-fn print_coin_amount(chain_config: &ChainConfig, value: Amount) -> String {
- value.into_fixedpoint_str(chain_config.coin_decimals())
-}
-
-fn print_margin_ratio(value: PerThousand) -> String {
- value.to_percentage_str()
-}
-
-fn print_coin_amount_with_ticker(chain_config: &ChainConfig, value: Amount) -> String {
- format!(
- "{} {}",
- print_coin_amount(chain_config, value),
- chain_config.coin_ticker()
- )
-}
-
-fn print_timestamp(timestamp: Duration) -> Option {
- let timestamp: i64 = timestamp.as_secs().try_into().ok()?;
- let timestamp = jiff::Timestamp::from_second(timestamp).ok()?;
-
- // To print in local timezone, use `jiff::tz::TimeZone::system()` instead of UTC.
- Some(
- timestamp
- .to_zoned_datetime(jiff::tz::TimeZone::UTC)
- .strftime("%Y-%m-%d %H:%M:%S")
- .to_string(),
- )
-}
-
-fn print_block_timestamp(timestamp: BlockTimestamp) -> String {
- print_timestamp(timestamp.as_duration_since_epoch())
- .unwrap_or_else(|| "Invalid timestamp".to_owned())
-}
-
-#[derive(Debug)]
-pub struct Peer {
- address: String,
- direction: ConnectionDirection,
- _services: Services,
- user_agent: UserAgent,
- version: SemVer,
-}
-
-pub struct MainWindow {
- main_menu: main_menu::MainMenu,
- main_widget: main_widget::MainWidget,
- language: wallet::wallet::Language,
- node_state: NodeState,
- popups: Vec,
- active_dialog: ActiveDialog,
-
- /// Disable the UI (by showing a modal widget) if a file dialog is active.
- /// Without this it is possible to open multiple file dialogs (which we don't want).
- file_dialog_active: bool,
- wallet_msg: Option,
-}
-
-#[derive(Debug, Clone, PartialEq, Eq)]
-pub enum WalletArgs {
- Software {
- mnemonic: String,
- is_cold: bool,
- },
- #[cfg(feature = "trezor")]
- Trezor,
- #[cfg(feature = "ledger")]
- Ledger,
-}
-
-impl From<&WalletArgs> for WalletType {
- fn from(value: &WalletArgs) -> Self {
- match value {
- WalletArgs::Software {
- mnemonic: _,
- is_cold,
- } => {
- if *is_cold {
- WalletType::Cold
- } else {
- WalletType::Hot
- }
- }
- #[cfg(feature = "trezor")]
- WalletArgs::Trezor => WalletType::Trezor,
- #[cfg(feature = "ledger")]
- WalletArgs::Ledger => WalletType::Ledger,
- }
- }
-}
-
-#[derive(Debug, Clone)]
-pub enum MainWindowMessage {
- MenuMessage(main_menu::MenuMessage),
- MainWidgetMessage(main_widget::MainWidgetMessage),
- FromBackend(BackendEvent),
-
- OpenWalletFileSelected {
- file_path: PathBuf,
- wallet_type: WalletType,
- },
- OpenWalletFileCanceled,
-
- ImportWalletMnemonic {
- args: WalletArgs,
- import: ImportOrCreate,
- },
- ImportWalletFileSelected {
- wallet_args: WalletTypeArgs,
- file_path: PathBuf,
- import: ImportOrCreate,
- wallet_type: WalletType,
- },
- ImportWalletFileCanceled,
-
- WalletSetPassword {
- wallet_id: WalletId,
- password1: String,
- password2: String,
- },
- WalletUnlock {
- wallet_id: WalletId,
- password: String,
- },
-
- NewWalletAccount {
- wallet_id: WalletId,
- name: String,
- },
-
- SubmitTx {
- wallet_id: WalletId,
- tx: SignedTransactionWrapper,
- },
-
- CopyToClipboard(String),
- ClosePopup,
- CloseDialog,
-}
-
-impl MainWindow {
- pub fn new(initialized_node: InitializedNode, wallet_mode: WalletMode) -> Self {
- let InitializedNode {
- chain_config,
- chain_info,
- } = initialized_node;
-
- let node_state = NodeState {
- chain_config,
- chain_info,
- connected_peers: BTreeMap::new(),
- wallets: BTreeMap::new(),
- };
-
- Self {
- main_menu: main_menu::MainMenu::new(wallet_mode),
- main_widget: main_widget::MainWidget::new(wallet_mode),
- // TODO: Support other languages
- language: wallet::wallet::Language::English,
- node_state,
- popups: Vec::new(),
- active_dialog: ActiveDialog::None,
- file_dialog_active: false,
- wallet_msg: None,
- }
- }
-
- pub fn node_state(&self) -> &NodeState {
- &self.node_state
- }
-
- pub fn show_error(&mut self, message: String) {
- self.popups.push(Popup {
- title: "Error".to_owned(),
- message,
- })
- }
-
- pub fn show_info(&mut self, message: String) {
- self.popups.push(Popup {
- title: "Info".to_owned(),
- message,
- })
- }
-
- pub fn update(
- &mut self,
- msg: MainWindowMessage,
- backend_sender: &BackendSender,
- ) -> Task {
- match msg {
- MainWindowMessage::MenuMessage(menu_message) => {
- // Note: iced_aw's menu has an annoying bug/feature - when a menu item is clicked, the drop down menu
- // won't close automatically, allowing the user to continue clicking on menu items.
- // E.g. see https://github.com/iced-rs/iced_aw/issues/312
- // This allows the user to mess things up by opening dialogs on top of dialogs; to prevent this,
- // we first check if a dialog is already open and ignore the event in such a case.
- if self.active_dialog != ActiveDialog::None || self.file_dialog_active {
- Task::none()
- } else {
- match menu_message {
- MenuMessage::NoOp => Task::none(),
- MenuMessage::CreateNewWallet { wallet_type } => {
- let wallet_args = match wallet_type {
- WalletType::Hot | WalletType::Cold => WalletArgs::Software {
- mnemonic: wallet_controller::mnemonic::generate_new_mnemonic(
- self.language,
- )
- .to_string(),
- is_cold: wallet_type == WalletType::Cold,
- },
- #[cfg(feature = "trezor")]
- WalletType::Trezor => WalletArgs::Trezor,
- #[cfg(feature = "ledger")]
- WalletType::Ledger => WalletArgs::Ledger,
- };
- self.active_dialog = ActiveDialog::WalletCreate { wallet_args };
- Task::none()
- }
- MenuMessage::RecoverWallet { wallet_type } => {
- self.active_dialog = ActiveDialog::WalletRecover { wallet_type };
- Task::none()
- }
- MenuMessage::OpenWallet { wallet_type } => {
- self.file_dialog_active = true;
- Task::perform(
- async move {
- let file_opt = AsyncFileDialog::new().pick_file().await;
- if let Some(file) = file_opt {
- log::info!("Open wallet file: {file:?}");
- MainWindowMessage::OpenWalletFileSelected {
- file_path: file.path().to_owned(),
- wallet_type,
- }
- } else {
- MainWindowMessage::OpenWalletFileCanceled
- }
- },
- identity,
- )
- }
- MenuMessage::Exit => {
- iced::window::get_latest().and_then(iced::window::close)
- }
- }
- }
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(wallet_id, WalletMessage::SetPassword),
- )) => {
- self.active_dialog = ActiveDialog::WalletSetPassword { wallet_id };
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(wallet_id, WalletMessage::RemovePassword),
- )) => {
- backend_sender.send(BackendRequest::UpdateEncryption {
- wallet_id,
- action: EncryptionAction::RemovePassword,
- });
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(wallet_id, WalletMessage::Lock),
- )) => {
- backend_sender.send(BackendRequest::UpdateEncryption {
- wallet_id,
- action: EncryptionAction::Lock,
- });
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(wallet_id, WalletMessage::Unlock),
- )) => {
- self.active_dialog = ActiveDialog::WalletUnlock { wallet_id };
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(wallet_id, WalletMessage::NewAccount),
- )) => {
- self.active_dialog = ActiveDialog::NewAccount { wallet_id };
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::TabsMessage(
- TabsMessage::WalletMessage(_wallet_id, WalletMessage::StillSyncing),
- )) => {
- self.show_info("The wallet is still syncing...".into());
- Task::none()
- }
-
- MainWindowMessage::MainWidgetMessage(main_widget_message) => self
- .main_widget
- .update(main_widget_message, backend_sender)
- .map(MainWindowMessage::MainWidgetMessage),
-
- MainWindowMessage::FromBackend(from_msg) => match from_msg {
- BackendEvent::ChainInfo(chain_info) => {
- self.node_state.chain_info = chain_info;
- Task::none()
- }
- BackendEvent::P2p(P2pEvent::PeerConnected {
- id,
- services,
- address,
- direction,
- user_agent,
- software_version: version,
- }) => {
- self.node_state.connected_peers.insert(
- id,
- Peer {
- address,
- direction,
- _services: services,
- user_agent,
- version,
- },
- );
- Task::none()
- }
- BackendEvent::P2p(P2pEvent::PeerDisconnected(peer_id)) => {
- self.node_state.connected_peers.remove(&peer_id);
- Task::none()
- }
-
- BackendEvent::OpenWallet(Ok(wallet_info))
- | BackendEvent::ImportWallet(Ok(wallet_info)) => {
- self.active_dialog = ActiveDialog::None;
- let wallet_id = wallet_info.wallet_id;
- let wallet_type = wallet_info.wallet_type;
- self.node_state.wallets.insert(wallet_id, wallet_info);
-
- Task::done(MainWindowMessage::MainWidgetMessage(
- MainWidgetMessage::WalletAdded {
- wallet_id,
- wallet_type,
- },
- ))
- }
-
- BackendEvent::OpenWallet(Err(error)) | BackendEvent::ImportWallet(Err(error)) => {
- self.show_error(error.to_string());
- self.file_dialog_active = false;
- self.active_dialog = ActiveDialog::None;
- Task::none()
- }
-
- BackendEvent::CloseWallet(wallet_id) => Task::perform(async {}, move |_| {
- MainWindowMessage::MainWidgetMessage(MainWidgetMessage::WalletRemoved(
- wallet_id,
- ))
- }),
-
- BackendEvent::UpdateEncryption(Ok((wallet_id, encryption))) => {
- self.active_dialog = ActiveDialog::None;
- if let Some(wallet) = self.node_state.wallets.get_mut(&wallet_id) {
- wallet.encryption = encryption;
- }
- Task::none()
- }
- BackendEvent::UpdateEncryption(Err(err)) => {
- self.active_dialog = ActiveDialog::None;
- self.show_error(err.to_string());
- Task::none()
- }
-
- BackendEvent::NewAccount(Ok((wallet_id, account_id, account_info))) => {
- self.active_dialog = ActiveDialog::None;
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (NewAccount)")
- .accounts
- .insert(account_id, account_info);
- Task::none()
- }
- BackendEvent::NewAccount(Err(err)) => {
- self.show_error(err.to_string());
- Task::none()
- }
-
- BackendEvent::WalletBestBlock(wallet_id, best_block) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (BestBlock)")
- .best_block = best_block;
- Task::none()
- }
-
- BackendEvent::Balance(wallet_id, account_id, balance) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (balance)")
- .accounts
- .get_mut(&account_id)
- .expect("account must be known (balance)")
- .balance = balance;
- Task::none()
- }
- BackendEvent::StakingBalance(wallet_id, account_id, staking_balance) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (staking balance)")
- .accounts
- .get_mut(&account_id)
- .expect("account must be known (staking balance)")
- .staking_balance = staking_balance;
- Task::none()
- }
- BackendEvent::DelegationsBalance(wallet_id, account_id, delegations_balance) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (staking balance)")
- .accounts
- .get_mut(&account_id)
- .expect("account must be known (staking balance)")
- .delegations_balance = delegations_balance;
- Task::none()
- }
- BackendEvent::NewAddress(Ok(address_info)) => {
- self.node_state
- .wallets
- .get_mut(&address_info.wallet_id)
- .expect("wallet must be known (NewAddress)")
- .accounts
- .get_mut(&address_info.account_id)
- .expect("account must be known (NewAddress)")
- .addresses
- .insert(address_info.index, address_info.address);
- Task::none()
- }
- BackendEvent::NewAddress(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::ToggleStaking(Ok((wallet_id, account_id, enabled))) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (ToggleStaking)")
- .accounts
- .get_mut(&account_id)
- .expect("account must be known (ToggleStaking)")
- .staking_enabled = enabled;
- Task::none()
- }
- BackendEvent::ToggleStaking(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::SendAmount(Ok(transaction_info)) => {
- self.wallet_msg = Some(WalletMessage::SendSucceed);
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::SendAmount(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::StakeAmount(Ok(transaction_info)) => {
- self.wallet_msg = Some(WalletMessage::CreateStakingPoolSucceed);
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::StakeAmount(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::DecommissionPool(Ok(transaction_info)) => {
- self.wallet_msg = Some(WalletMessage::DecommissionPoolSucceed);
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::DecommissionPool(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::CreateDelegation(Ok(transaction_info)) => {
- self.wallet_msg = Some(WalletMessage::CreateDelegationSucceed);
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::CreateDelegation(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::DelegateStaking(Ok((transaction_info, delegation_id))) => {
- self.wallet_msg = Some(WalletMessage::DelegateStakingSucceed(delegation_id));
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::DelegateStaking(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::SendDelegationToAddress(Ok(transaction_info)) => {
- self.wallet_msg = Some(WalletMessage::SendDelegationToAddressSucceed);
- self.active_dialog = ActiveDialog::ConfirmTransaction { transaction_info };
- Task::none()
- }
- BackendEvent::SendDelegationToAddress(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::Broadcast(Ok(wallet_id)) => {
- self.active_dialog = ActiveDialog::None;
- self.show_info(
- "Success. Please wait for your transaction to be included in a block."
- .to_owned(),
- );
-
- if let Some(wallet_msg) = self.wallet_msg.take() {
- self.main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id, wallet_msg,
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage)
- } else {
- Task::none()
- }
- }
- BackendEvent::Broadcast(Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::TransactionList(wallet_id, account_id, Ok(transaction_list)) => {
- self.node_state
- .wallets
- .get_mut(&wallet_id)
- .expect("wallet must be known (TransactionList)")
- .accounts
- .get_mut(&account_id)
- .expect("account must be known (TransactionList)")
- .transaction_list = transaction_list;
- Task::none()
- }
- BackendEvent::TransactionList(_wallet_id, _account_id, Err(error)) => {
- self.show_error(error.to_string());
- Task::none()
- }
- BackendEvent::ConsoleResponse(wallet_id, _account_id, Ok(command)) => match command
- {
- ConsoleCommand::SetStatus {
- status: _,
- print_message: out,
- }
- | ConsoleCommand::Print(out)
- | ConsoleCommand::Warn(out) => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(out),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- ConsoleCommand::Json { text, value } => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(
- wallet_cli_commands::output::json_display_text(text, &value),
- ),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- ConsoleCommand::PaginatedPrint { header, body } => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(header + &body),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- ConsoleCommand::ChoiceMenu(menu) => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(format!(
- "{}\n{}",
- menu.header(),
- menu.choice_list().join("\n")
- )),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- ConsoleCommand::ClearScreen
- | ConsoleCommand::ClearHistory
- | ConsoleCommand::PrintHistory
- | ConsoleCommand::Exit => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(String::new()),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- },
- BackendEvent::ConsoleResponse(wallet_id, _account_id, Err(error)) => self
- .main_widget
- .update(
- MainWidgetMessage::TabsMessage(TabsMessage::WalletMessage(
- wallet_id,
- WalletMessage::ConsoleOutput(error.to_string()),
- )),
- backend_sender,
- )
- .map(MainWindowMessage::MainWidgetMessage),
- },
- MainWindowMessage::OpenWalletFileSelected {
- file_path,
- wallet_type,
- } => {
- self.file_dialog_active = false;
- backend_sender.send(BackendRequest::OpenWallet {
- file_path,
- wallet_type,
- });
- Task::none()
- }
- MainWindowMessage::OpenWalletFileCanceled => {
- self.file_dialog_active = false;
- Task::none()
- }
-
- MainWindowMessage::ImportWalletMnemonic { args, import } => {
- let wallet_type = (&args).into();
- let wallet_args = match args {
- WalletArgs::Software {
- mnemonic,
- is_cold: _,
- } => {
- let mnemonic_res =
- wallet_controller::mnemonic::parse_mnemonic(self.language, &mnemonic);
- match mnemonic_res {
- Ok(mnemonic) => WalletTypeArgs::Software {
- mnemonic: Some(mnemonic.to_string()),
- passphrase: None,
- store_seed_phrase: StoreSeedPhrase::Store,
- },
- Err(err) => {
- self.show_error(err.to_string());
- return Task::none();
- }
- }
- }
- #[cfg(feature = "trezor")]
- WalletArgs::Trezor => WalletTypeArgs::Trezor { device_id: None },
- #[cfg(feature = "ledger")]
- WalletArgs::Ledger => WalletTypeArgs::Ledger,
- };
-
- self.file_dialog_active = true;
- Task::perform(
- async move {
- let file_opt = AsyncFileDialog::new().save_file().await;
- if let Some(file) = file_opt {
- log::info!("Save wallet file: {file:?}");
- MainWindowMessage::ImportWalletFileSelected {
- wallet_args,
- file_path: file.path().to_owned(),
- import,
- wallet_type,
- }
- } else {
- MainWindowMessage::ImportWalletFileCanceled
- }
- },
- identity,
- )
- }
- MainWindowMessage::ImportWalletFileSelected {
- wallet_args,
- file_path,
- import,
- wallet_type,
- } => {
- self.file_dialog_active = false;
-
- backend_sender.send(BackendRequest::RecoverWallet {
- wallet_args,
- file_path,
- import,
- wallet_type,
- });
- Task::none()
- }
- MainWindowMessage::ImportWalletFileCanceled => {
- self.file_dialog_active = false;
- self.active_dialog = ActiveDialog::None;
- Task::none()
- }
-
- MainWindowMessage::WalletSetPassword {
- wallet_id,
- password1,
- password2,
- } => {
- if password1 != password2 {
- self.show_error("Passwords do not match".to_string());
- } else {
- backend_sender.send(BackendRequest::UpdateEncryption {
- wallet_id,
- action: EncryptionAction::SetPassword(password1),
- });
- }
- Task::none()
- }
-
- MainWindowMessage::WalletUnlock {
- wallet_id,
- password,
- } => {
- backend_sender.send(BackendRequest::UpdateEncryption {
- wallet_id,
- action: EncryptionAction::Unlock(password),
- });
- Task::none()
- }
-
- MainWindowMessage::NewWalletAccount { wallet_id, name } => {
- backend_sender.send(BackendRequest::NewAccount { wallet_id, name });
- Task::none()
- }
-
- MainWindowMessage::SubmitTx { wallet_id, tx } => {
- backend_sender.send(BackendRequest::SubmitTx { wallet_id, tx });
- Task::none()
- }
-
- MainWindowMessage::CopyToClipboard(text) => iced::clipboard::write(text),
-
- MainWindowMessage::ClosePopup => {
- self.popups.pop();
- Task::none()
- }
- MainWindowMessage::CloseDialog => {
- self.active_dialog = ActiveDialog::None;
- Task::none()
- }
- }
- }
-
- pub fn view(&self) -> Element<'_, MainWindowMessage> {
- let main_content = iced::widget::column![
- self.main_menu.view().map(MainWindowMessage::MenuMessage),
- self.main_widget
- .view(&self.node_state)
- .map(MainWindowMessage::MainWidgetMessage),
- ];
-
- let show_dialog = self.active_dialog != ActiveDialog::None;
- let dialog = show_dialog
- .then(move || -> Element {
- match &self.active_dialog {
- ActiveDialog::None => Text::new("Nothing to show").into(),
-
- ActiveDialog::WalletCreate { wallet_args } => {
- let create = ImportOrCreate::Create;
- match wallet_args {
- WalletArgs::Software { mnemonic, is_cold } => {
- let is_cold = *is_cold;
- wallet_mnemonic_dialog(
- Some(mnemonic.clone()),
- Box::new(move |mnemonic| {
- MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Software { mnemonic, is_cold },
- import: create,
- }
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- Box::new(MainWindowMessage::CopyToClipboard),
- )
- .into()
- }
- #[cfg(feature = "trezor")]
- WalletArgs::Trezor => hw_wallet_create_dialog(
- Box::new(move || MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Trezor,
- import: create,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- create,
- HardwareWalletType::Trezor,
- )
- .into(),
- #[cfg(feature = "ledger")]
- WalletArgs::Ledger => hw_wallet_create_dialog(
- Box::new(move || MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Ledger,
- import: create,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- create,
- HardwareWalletType::Ledger,
- )
- .into(),
- }
- }
- ActiveDialog::WalletRecover { wallet_type } => {
- let is_cold = *wallet_type == WalletType::Cold;
- let import = ImportOrCreate::Import;
- match wallet_type {
- WalletType::Hot | WalletType::Cold => wallet_mnemonic_dialog(
- None,
- Box::new(move |mnemonic| MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Software { mnemonic, is_cold },
- import,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- Box::new(MainWindowMessage::CopyToClipboard),
- )
- .into(),
- #[cfg(feature = "trezor")]
- WalletType::Trezor => hw_wallet_create_dialog(
- Box::new(move || MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Trezor,
- import,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- import,
- HardwareWalletType::Trezor,
- )
- .into(),
- #[cfg(feature = "ledger")]
- WalletType::Ledger => hw_wallet_create_dialog(
- Box::new(move || MainWindowMessage::ImportWalletMnemonic {
- args: WalletArgs::Ledger,
- import,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- import,
- HardwareWalletType::Ledger,
- )
- .into(),
- }
- }
-
- ActiveDialog::WalletSetPassword { wallet_id } => {
- let wallet_id = *wallet_id;
- wallet_set_password_dialog(
- Box::new(move |password1, password2| {
- MainWindowMessage::WalletSetPassword {
- wallet_id,
- password1,
- password2,
- }
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- )
- .into()
- }
-
- ActiveDialog::WalletUnlock { wallet_id } => {
- let wallet_id = *wallet_id;
- wallet_unlock_dialog(
- Box::new(move |password| MainWindowMessage::WalletUnlock {
- wallet_id,
- password,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- )
- .into()
- }
-
- ActiveDialog::NewAccount { wallet_id } => {
- let wallet_id = *wallet_id;
- new_wallet_account(
- Box::new(move |name| MainWindowMessage::NewWalletAccount {
- wallet_id,
- name,
- }),
- Box::new(|| MainWindowMessage::CloseDialog),
- )
- .into()
- }
-
- ActiveDialog::ConfirmTransaction { transaction_info } => {
- let wallet_id = transaction_info.wallet_id;
- new_confirm_broadcast(
- Box::new(move |tx| MainWindowMessage::SubmitTx { wallet_id, tx }),
- Box::new(|| MainWindowMessage::CloseDialog),
- Box::new(MainWindowMessage::CopyToClipboard),
- transaction_info.tx.clone(),
- self.node_state.chain_config.clone(),
- )
- .into()
- }
- }
- })
- .map(|d| {
- esc_handler(
- centered_with_opaque_blurred_bg(d),
- Some(MainWindowMessage::CloseDialog),
- )
- });
-
- let popup: Option> =
- match (self.file_dialog_active, self.popups.last()) {
- (true, _) => Some(bordered_text_on_normal_bg("File dialog...")),
- (_, Some(popup)) => {
- Some(popup_dialog(popup.clone(), MainWindowMessage::ClosePopup).into())
- }
- (_, None) => None,
- };
- let popup = popup.map(|d| {
- esc_handler(
- centered_with_opaque_blurred_bg(d),
- (!self.file_dialog_active).then_some(MainWindowMessage::ClosePopup),
- )
- });
-
- Stack::with_children(std::iter::once(main_content.into()).chain(dialog).chain(popup))
- .width(Length::Fill)
- .height(Length::Fill)
- .into()
- }
-}
-
-fn bordered_text_on_normal_bg<'a, Message: 'a>(text: &'a str) -> Element<'a, Message> {
- container(Text::new(text))
- .style(|theme: &iced::Theme| {
- let palette = theme.extended_palette();
-
- container::Style {
- background: Some(palette.background.base.color.into()),
- border: iced::Border {
- width: 1.0,
- radius: 2.0.into(),
- color: palette.background.strong.color,
- },
- ..container::Style::default()
- }
- })
- .padding([5, 10])
- .into()
-}
-
-/// Create a container that
-/// 1) fills all the available space and centers the provided content inside;
-/// 2) is opaque to mouse events;
-/// 3) uses semi-transparent white as the background, which creates the blurred background effect.
-fn centered_with_opaque_blurred_bg<'a, Message: 'a>(
- content: impl Into>,
-) -> Element<'a, Message> {
- opaque(center(content).style(|_theme| {
- container::Style {
- background: Some(
- iced::Color {
- a: 0.5,
- ..iced::Color::WHITE
- }
- .into(),
- ),
- ..container::Style::default()
- }
- }))
-}
diff --git a/node-gui/src/widgets/confirm_broadcast.rs b/node-gui/src/widgets/confirm_broadcast.rs
deleted file mode 100644
index 4e0f10c25c..0000000000
--- a/node-gui/src/widgets/confirm_broadcast.rs
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::sync::Arc;
-
-#[allow(deprecated)]
-use iced::widget::Component;
-
-use iced::{
- Element, Length, Theme,
- alignment::Horizontal,
- widget::{self, Button, Text, container},
-};
-use iced_aw::Card;
-
-use common::chain::ChainConfig;
-use node_gui_backend::messages::SignedTransactionWrapper;
-
-pub struct ConfirmBroadcast {
- on_submit: Box Message>,
- on_close: Box Message>,
- on_copy_to_clipboard: Box Message>,
- tx: SignedTransactionWrapper,
- chain_config: Arc,
-}
-
-pub fn new_confirm_broadcast(
- on_submit: Box Message>,
- on_close: Box Message>,
- on_copy_to_clipboard: Box Message>,
- tx: SignedTransactionWrapper,
- chain_config: Arc,
-) -> ConfirmBroadcast {
- ConfirmBroadcast {
- on_submit,
- on_close,
- on_copy_to_clipboard,
- tx,
- chain_config,
- }
-}
-
-#[derive(Default)]
-pub struct ConfirmBroadcastState {}
-
-#[derive(Clone)]
-pub enum ConfirmBroadcastEvent {
- Ok,
- Cancel,
- CopyToClipboard(String),
-}
-
-#[allow(deprecated)]
-impl Component for ConfirmBroadcast {
- type State = ConfirmBroadcastState;
- type Event = ConfirmBroadcastEvent;
-
- fn update(&mut self, _state: &mut Self::State, event: Self::Event) -> Option {
- match event {
- ConfirmBroadcastEvent::Ok => Some((self.on_submit)(self.tx.clone())),
- ConfirmBroadcastEvent::Cancel => Some((self.on_close)()),
- ConfirmBroadcastEvent::CopyToClipboard(text) => Some((self.on_copy_to_clipboard)(text)),
- }
- }
-
- fn view(&self, _state: &Self::State) -> Element<'_, Self::Event, Theme, iced::Renderer> {
- let summary = self.tx.text_summary(&self.chain_config);
-
- let button = Button::new(Text::new("Confirm and broadcast").align_x(Horizontal::Center))
- .width(220.0)
- .on_press(ConfirmBroadcastEvent::Ok);
-
- let copy_to_clipboard = Button::new(
- Text::new(iced_fonts::Bootstrap::ClipboardCheck.to_string())
- .font(iced_fonts::BOOTSTRAP_FONT),
- )
- .style(iced::widget::button::text)
- .on_press(ConfirmBroadcastEvent::CopyToClipboard(summary.clone()));
-
- Card::new(
- Text::new("Confirm submit transaction"),
- iced::widget::column![iced::widget::text(summary).font(iced::font::Font {
- family: iced::font::Family::Monospace,
- weight: Default::default(),
- stretch: Default::default(),
- style: iced::font::Style::Normal,
- }),],
- )
- .foot(
- container(iced::widget::row![
- iced::widget::Space::new(Length::Fill, Length::Shrink),
- container(button).center_x(Length::Shrink),
- iced::widget::Space::new(Length::Fill, Length::Shrink),
- container(copy_to_clipboard).align_x(Horizontal::Right)
- ])
- .width(Length::Fill),
- )
- .max_width(1200.0)
- .on_close(ConfirmBroadcastEvent::Cancel)
- .into()
- }
-}
-
-impl<'a, Message> From> for Element<'a, Message, Theme, iced::Renderer>
-where
- Message: 'a,
-{
- fn from(component: ConfirmBroadcast) -> Self {
- #[allow(deprecated)]
- widget::component(component)
- }
-}
diff --git a/node-gui/src/widgets/create_hw_wallet.rs b/node-gui/src/widgets/create_hw_wallet.rs
deleted file mode 100644
index 2ad534601e..0000000000
--- a/node-gui/src/widgets/create_hw_wallet.rs
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2021-2024 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#[allow(deprecated)]
-use iced::widget::Component;
-
-use iced::{
- Element, Length, Theme,
- alignment::Horizontal,
- widget::{self, Button, Text, container, text},
-};
-use iced_aw::Card;
-
-use wallet_types::ImportOrCreate;
-
-#[derive(Debug, Clone, Copy)]
-pub enum HardwareWalletType {
- #[cfg(feature = "trezor")]
- Trezor,
- #[cfg(feature = "ledger")]
- Ledger,
-}
-
-impl HardwareWalletType {
- fn name(self) -> &'static str {
- match self {
- #[cfg(feature = "trezor")]
- Self::Trezor => "Trezor",
- #[cfg(feature = "ledger")]
- Self::Ledger => "Ledger",
- }
- }
-}
-
-pub struct CreateHwWalletDialog {
- on_import: Box Message>,
- on_close: Box Message>,
- mode: ImportOrCreate,
- hw_wallet_type: HardwareWalletType,
-}
-
-pub fn hw_wallet_create_dialog(
- on_import: Box Message>,
- on_close: Box Message>,
- mode: ImportOrCreate,
- hw_wallet_type: HardwareWalletType,
-) -> CreateHwWalletDialog {
- CreateHwWalletDialog {
- on_import,
- on_close,
- mode,
- hw_wallet_type,
- }
-}
-
-#[derive(Default)]
-pub struct ImportState {
- importing: bool,
-}
-
-#[derive(Clone)]
-pub enum ImportEvent {
- Ok,
- Cancel,
-}
-
-#[allow(deprecated)]
-impl Component for CreateHwWalletDialog {
- type State = ImportState;
- type Event = ImportEvent;
-
- fn update(&mut self, state: &mut Self::State, event: Self::Event) -> Option {
- match event {
- ImportEvent::Ok => {
- state.importing = true;
- Some((self.on_import)())
- }
- ImportEvent::Cancel => Some((self.on_close)()),
- }
- }
-
- fn view(&self, state: &Self::State) -> Element<'_, Self::Event, Theme, iced::Renderer> {
- let button = Button::new(Text::new("Select file").align_x(Horizontal::Center))
- .width(100.0)
- .on_press(ImportEvent::Ok);
-
- let hw_wallet_name = self.hw_wallet_type.name();
-
- let card = match self.mode {
- ImportOrCreate::Create => Card::new(
- Text::new("Create new Wallet"),
- Text::new(format!(
- "Create a new {hw_wallet_name} wallet using the connected {hw_wallet_name} device"
- )),
- ),
- ImportOrCreate::Import => Card::new(
- Text::new("Recover new Wallet"),
- Text::new(format!(
- "Recover a new wallet using the connected {hw_wallet_name} device"
- )),
- ),
- };
- if state.importing {
- card.foot(container(text("Loading...")).center_x(Length::Fill))
- } else {
- card.foot(container(button).center_x(Length::Fill))
- .on_close(ImportEvent::Cancel)
- }
- .max_width(600.0)
- .into()
- }
-}
-
-impl<'a, Message> From>
- for Element<'a, Message, Theme, iced::Renderer>
-where
- Message: 'a,
-{
- fn from(component: CreateHwWalletDialog) -> Self {
- #[allow(deprecated)]
- widget::component(component)
- }
-}
diff --git a/node-gui/src/widgets/esc_handler.rs b/node-gui/src/widgets/esc_handler.rs
deleted file mode 100644
index 953c54ca06..0000000000
--- a/node-gui/src/widgets/esc_handler.rs
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) 2025 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Element, Event, Length, Rectangle, Size, Vector,
- advanced::{
- Clipboard, Layout, Shell, Widget, layout, renderer,
- widget::{Operation, Tree, tree},
- },
- event, keyboard,
- mouse::{self},
- overlay,
-};
-
-/// Wrap an element, capturing Esc key press events and optionally emitting the specified message
-/// on each key press.
-///
-/// Note: the Esc key press events will be consumed even if msg_to_emit is None.
-pub fn esc_handler<'a, Message, Theme, Renderer>(
- content: impl Into>,
- msg_to_emit: Option,
-) -> Element<'a, Message, Theme, Renderer>
-where
- Message: Clone + 'a,
- Theme: 'a,
- Renderer: iced::advanced::Renderer + 'a,
-{
- Element::new(EscHandler {
- content: content.into(),
- msg_to_emit,
- })
-}
-
-struct EscHandler<'a, Message, Theme, Renderer> {
- content: Element<'a, Message, Theme, Renderer>,
- msg_to_emit: Option,
-}
-
-impl Widget
- for EscHandler<'_, Message, Theme, Renderer>
-where
- Renderer: iced::advanced::Renderer,
- Message: Clone,
-{
- fn tag(&self) -> tree::Tag {
- self.content.as_widget().tag()
- }
-
- fn state(&self) -> tree::State {
- self.content.as_widget().state()
- }
-
- fn children(&self) -> Vec {
- self.content.as_widget().children()
- }
-
- fn diff(&self, tree: &mut Tree) {
- self.content.as_widget().diff(tree);
- }
-
- fn size(&self) -> Size {
- self.content.as_widget().size()
- }
-
- fn size_hint(&self) -> Size {
- self.content.as_widget().size_hint()
- }
-
- fn layout(
- &self,
- tree: &mut Tree,
- renderer: &Renderer,
- limits: &layout::Limits,
- ) -> layout::Node {
- self.content.as_widget().layout(tree, renderer, limits)
- }
-
- fn draw(
- &self,
- tree: &Tree,
- renderer: &mut Renderer,
- theme: &Theme,
- style: &renderer::Style,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- viewport: &Rectangle,
- ) {
- self.content
- .as_widget()
- .draw(tree, renderer, theme, style, layout, cursor, viewport);
- }
-
- fn operate(
- &self,
- state: &mut Tree,
- layout: Layout<'_>,
- renderer: &Renderer,
- operation: &mut dyn Operation,
- ) {
- self.content.as_widget().operate(state, layout, renderer, operation);
- }
-
- fn on_event(
- &mut self,
- state: &mut Tree,
- event: Event,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- renderer: &Renderer,
- clipboard: &mut dyn Clipboard,
- shell: &mut Shell<'_, Message>,
- viewport: &Rectangle,
- ) -> event::Status {
- let event_captured = match &event {
- Event::Keyboard(keyboard::Event::KeyPressed { key, .. })
- if *key == keyboard::Key::Named(keyboard::key::Named::Escape) =>
- {
- if let Some(msg) = &self.msg_to_emit {
- shell.publish(msg.clone());
- }
-
- true
- }
- _ => false,
- };
-
- if event_captured {
- event::Status::Captured
- } else {
- self.content.as_widget_mut().on_event(
- state, event, layout, cursor, renderer, clipboard, shell, viewport,
- )
- }
- }
-
- fn mouse_interaction(
- &self,
- state: &Tree,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- viewport: &Rectangle,
- renderer: &Renderer,
- ) -> mouse::Interaction {
- self.content
- .as_widget()
- .mouse_interaction(state, layout, cursor, viewport, renderer)
- }
-
- fn overlay<'b>(
- &'b mut self,
- state: &'b mut Tree,
- layout: Layout<'_>,
- renderer: &Renderer,
- translation: Vector,
- ) -> Option> {
- self.content.as_widget_mut().overlay(state, layout, renderer, translation)
- }
-}
diff --git a/node-gui/src/widgets/mod.rs b/node-gui/src/widgets/mod.rs
deleted file mode 100644
index c2fcbd3354..0000000000
--- a/node-gui/src/widgets/mod.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-pub mod confirm_broadcast;
-#[cfg(any(feature = "trezor", feature = "ledger"))]
-pub mod create_hw_wallet;
-pub mod esc_handler;
-pub mod new_wallet_account;
-pub mod opaque;
-pub mod popup_dialog;
-pub mod wallet_mnemonic;
-pub mod wallet_set_password;
-pub mod wallet_unlock;
diff --git a/node-gui/src/widgets/new_wallet_account.rs b/node-gui/src/widgets/new_wallet_account.rs
deleted file mode 100644
index f398f25728..0000000000
--- a/node-gui/src/widgets/new_wallet_account.rs
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Copyright (c) 2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#[allow(deprecated)]
-use iced::widget::Component;
-
-use iced::{
- Element, Length, Theme,
- alignment::Horizontal,
- widget::{self, Button, Text, container, text_input},
-};
-use iced_aw::Card;
-
-pub struct NewWalletAccount {
- on_submit: Box Message>,
- on_close: Box Message>,
-}
-
-pub fn new_wallet_account(
- on_submit: Box Message>,
- on_close: Box Message>,
-) -> NewWalletAccount {
- NewWalletAccount {
- on_submit,
- on_close,
- }
-}
-
-#[derive(Default)]
-pub struct NewAccountState {
- name: String,
-}
-
-#[derive(Clone)]
-pub enum NewAccountEvent {
- EditName(String),
- Ok,
- Cancel,
-}
-
-#[allow(deprecated)]
-impl Component for NewWalletAccount {
- type State = NewAccountState;
- type Event = NewAccountEvent;
-
- fn update(&mut self, state: &mut Self::State, event: Self::Event) -> Option {
- match event {
- NewAccountEvent::EditName(password) => {
- state.name = password;
- None
- }
- NewAccountEvent::Ok => Some((self.on_submit)(state.name.clone())),
- NewAccountEvent::Cancel => Some((self.on_close)()),
- }
- }
-
- fn view(&self, state: &Self::State) -> Element<'_, Self::Event, Theme, iced::Renderer> {
- let button = Button::new(Text::new("Create").align_x(Horizontal::Center))
- .width(100.0)
- .on_press(NewAccountEvent::Ok);
-
- Card::new(
- Text::new("New account"),
- iced::widget::column![
- text_input("Account name", &state.name)
- .on_input(NewAccountEvent::EditName)
- .padding(15)
- ],
- )
- .foot(container(button).center_x(Length::Fill))
- .max_width(600.0)
- .on_close(NewAccountEvent::Cancel)
- .into()
- }
-}
-
-impl<'a, Message> From> for Element<'a, Message, Theme, iced::Renderer>
-where
- Message: 'a,
-{
- fn from(component: NewWalletAccount) -> Self {
- #[allow(deprecated)]
- widget::component(component)
- }
-}
diff --git a/node-gui/src/widgets/opaque.rs b/node-gui/src/widgets/opaque.rs
deleted file mode 100644
index dd9fee21c0..0000000000
--- a/node-gui/src/widgets/opaque.rs
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) 2025 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use iced::{
- Element, Event, Length, Rectangle, Size, Vector,
- advanced::{
- Clipboard, Layout, Shell, Widget, layout, renderer,
- widget::{Operation, Tree, tree},
- },
- event,
- mouse::{self},
- overlay,
-};
-
-/// Wrap the given widget and capture any mouse events inside its bounds, effectively making it 'opaque'.
-///
-/// This helper is meant to be used to mark elements in a `Stack` to avoid mouse
-/// events from passing through layers.
-///
-/// Note: iced already has `opaque`, but their version only captures mouse presses. So e.g. tooltips
-/// under an "opaque" element would still receive mouse hover events. Our version of `opaque` captures
-/// all mouse events.
-pub fn opaque<'a, Message, Theme, Renderer>(
- content: impl Into>,
-) -> Element<'a, Message, Theme, Renderer>
-where
- Message: 'a,
- Theme: 'a,
- Renderer: iced::advanced::Renderer + 'a,
-{
- Element::new(Opaque {
- content: content.into(),
- })
-}
-
-struct Opaque<'a, Message, Theme, Renderer> {
- content: Element<'a, Message, Theme, Renderer>,
-}
-
-impl Widget
- for Opaque<'_, Message, Theme, Renderer>
-where
- Renderer: iced::advanced::Renderer,
-{
- fn tag(&self) -> tree::Tag {
- self.content.as_widget().tag()
- }
-
- fn state(&self) -> tree::State {
- self.content.as_widget().state()
- }
-
- fn children(&self) -> Vec {
- self.content.as_widget().children()
- }
-
- fn diff(&self, tree: &mut Tree) {
- self.content.as_widget().diff(tree);
- }
-
- fn size(&self) -> Size {
- self.content.as_widget().size()
- }
-
- fn size_hint(&self) -> Size {
- self.content.as_widget().size_hint()
- }
-
- fn layout(
- &self,
- tree: &mut Tree,
- renderer: &Renderer,
- limits: &layout::Limits,
- ) -> layout::Node {
- self.content.as_widget().layout(tree, renderer, limits)
- }
-
- fn draw(
- &self,
- tree: &Tree,
- renderer: &mut Renderer,
- theme: &Theme,
- style: &renderer::Style,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- viewport: &Rectangle,
- ) {
- self.content
- .as_widget()
- .draw(tree, renderer, theme, style, layout, cursor, viewport);
- }
-
- fn operate(
- &self,
- state: &mut Tree,
- layout: Layout<'_>,
- renderer: &Renderer,
- operation: &mut dyn Operation,
- ) {
- self.content.as_widget().operate(state, layout, renderer, operation);
- }
-
- fn on_event(
- &mut self,
- state: &mut Tree,
- event: Event,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- renderer: &Renderer,
- clipboard: &mut dyn Clipboard,
- shell: &mut Shell<'_, Message>,
- viewport: &Rectangle,
- ) -> event::Status {
- if let event::Status::Captured = self.content.as_widget_mut().on_event(
- state, event, layout, cursor, renderer, clipboard, shell, viewport,
- ) {
- return event::Status::Captured;
- }
-
- if cursor.is_over(layout.bounds()) {
- event::Status::Captured
- } else {
- event::Status::Ignored
- }
- }
-
- fn mouse_interaction(
- &self,
- state: &Tree,
- layout: Layout<'_>,
- cursor: mouse::Cursor,
- viewport: &Rectangle,
- renderer: &Renderer,
- ) -> mouse::Interaction {
- let interaction = self
- .content
- .as_widget()
- .mouse_interaction(state, layout, cursor, viewport, renderer);
-
- if interaction == mouse::Interaction::None && cursor.is_over(layout.bounds()) {
- mouse::Interaction::Idle
- } else {
- interaction
- }
- }
-
- fn overlay<'b>(
- &'b mut self,
- state: &'b mut Tree,
- layout: Layout<'_>,
- renderer: &Renderer,
- translation: Vector,
- ) -> Option> {
- self.content.as_widget_mut().overlay(state, layout, renderer, translation)
- }
-}
diff --git a/node-gui/src/widgets/popup_dialog.rs b/node-gui/src/widgets/popup_dialog.rs
deleted file mode 100644
index e5e98fdcb1..0000000000
--- a/node-gui/src/widgets/popup_dialog.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2021-2023 RBB S.r.l
-// opensource@mintlayer.org
-// SPDX-License-Identifier: MIT
-// Licensed under the MIT License;
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// https://github.com/mintlayer/mintlayer-core/blob/master/LICENSE
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#[allow(deprecated)]
-use iced::widget::Component;
-
-use iced::{
- Element, Length, Theme,
- alignment::Horizontal,
- widget::{self, Button, Text, container},
-};
-use iced_aw::Card;
-
-#[derive(Clone)]
-pub struct Popup {
- pub title: String,
- pub message: String,
-}
-
-pub struct PopupDialog {
- pub popup: Popup,
- pub on_close: Message,
-}
-
-pub fn popup_dialog(popup: Popup, on_close: Message) -> PopupDialog {
- PopupDialog { popup, on_close }
-}
-
-#[allow(deprecated)]
-impl