Skip to content

[wallet/symbol/mobile] feat: add mosaic management screens and module - #2377

Open
OlegMakarenko wants to merge 19 commits into
devfrom
wallet-symbol-mobile/mosaic
Open

[wallet/symbol/mobile] feat: add mosaic management screens and module#2377
OlegMakarenko wants to merge 19 commits into
devfrom
wallet-symbol-mobile/mosaic

Conversation

@OlegMakarenko

@OlegMakarenko OlegMakarenko commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

The Mobile Wallet currently has no support for mosaic (token) management. Users are able to view mosaic/token details, but cannot create new mosaics, modify their supply, or revoke them from holder accounts directly within the app. Any such operations require Desktop Wallet.

Solution

Introduced mosaic management functionality across a new service layer and three new screens:

  • Added TokenService under wallet/common/symbol, encapsulating transaction creation for:

    • Create mosaic — mosaic definition + supply change transactions.
    • Modify mosaic — supply change transactions.
    • Revoke mosaic — mosaic revocation transactions.
  • Added the CreateMosaic screen, including:

    • A custom divisibility selector.
    • An explanatory card describing supply change and divisibility behavior.
    • Input validation for total supply and divisibility.
    • A complex duration selector supporting both exact block counts and human-friendly units (minutes, hours, days, months, years), with automatic conversion to blocks.
    • Checkboxes for the four mosaic flags: supply mutable, transferable, restrictable, and revocable.
  • Added the RevokeMosaic screen, including:

    • Fetching the list of accounts holding the mosaic passed via params.
    • A selector displaying these accounts along with their balances.
    • An amount input validated against the selected account's max balance.
  • Added the ModifyMosaic screen, including:

    • Display of current total supply.
    • A custom supply delta selector component.
    • A presentation component showing current supply, new supply, and the resulting delta.
  • Updated the TokenDetails screen with new buttons to launch RevokeMosaic and ModifyMosaic, conditionally rendered based on mosaic state (e.g. revocable, not expired).

  • Added CreateMosaic as a new entry point on the Actions screen.

@OlegMakarenko
OlegMakarenko force-pushed the wallet-symbol-mobile/mosaic branch from e77a875 to 35386c8 Compare July 21, 2026 11:22
@OlegMakarenko
OlegMakarenko marked this pull request as ready for review July 23, 2026 15:16
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.72986% with 141 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.39%. Comparing base (587dfa6) to head (c09bf6f).
⚠️ Report is 2 commits behind head on dev.

Files with missing lines Patch % Lines
...le/src/screens/mosaic/components/InputDuration.jsx 78.89% 61 Missing ⚠️
.../symbol/mobile/src/screens/mosaic/CreateMosaic.jsx 94.44% 17 Missing and 1 partial ⚠️
...mobile/src/screens/mosaic/utils/mosaic-duration.js 88.99% 12 Missing ⚠️
.../symbol/mobile/src/screens/mosaic/RevokeMosaic.jsx 95.95% 7 Missing and 3 partials ⚠️
.../symbol/mobile/src/screens/mosaic/ModifyMosaic.jsx 96.00% 7 Missing and 2 partials ⚠️
...rc/screens/mosaic/components/MosaicPreviewCard.jsx 94.35% 7 Missing ⚠️
.../src/screens/mosaic/components/SupplyDeltaCard.jsx 98.63% 2 Missing and 3 partials ⚠️
...c/screens/mosaic/hooks/useCreateMosaicFormState.js 94.25% 5 Missing ⚠️
wallet/symbol/mobile/src/router/Router.js 55.55% 4 Missing ⚠️
...l/mobile/src/screens/mosaic/utils/mosaic-supply.js 97.61% 3 Missing ⚠️
... and 4 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2377      +/-   ##
==========================================
+ Coverage   95.36%   95.39%   +0.02%     
==========================================
  Files         679      708      +29     
  Lines       50606    53888    +3282     
  Branches     1403     1556     +153     
==========================================
+ Hits        48261    51406    +3145     
- Misses       2286     2414     +128     
- Partials       59       68       +9     
Flag Coverage Δ
wallet-common-symbol 97.05% <100.00%> (+0.36%) ⬆️
wallet-mobile-symbol 94.29% <95.35%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
wallet/common/symbol/src/modules/TokenModule.js 100.00% <100.00%> (ø)
...t/common/symbol/src/utils/transaction-to-symbol.js 99.66% <100.00%> (ø)
...bol/mobile/src/components/controls/SelectToken.jsx 100.00% <100.00%> (ø)
...rc/components/controls/SelectTransactionSender.jsx 97.61% <100.00%> (+0.04%) ⬆️
...ymbol/mobile/src/components/display/Token/index.js 100.00% <100.00%> (ø)
...llet/symbol/mobile/src/components/layout/Field.jsx 100.00% <100.00%> (ø)
wallet/symbol/mobile/src/hooks/useValidation.js 100.00% <100.00%> (ø)
...bol/mobile/src/lib/controller/symbol/controller.js 100.00% <100.00%> (ø)
wallet/symbol/mobile/src/router/RouterView.jsx 90.17% <100.00%> (+0.27%) ⬆️
wallet/symbol/mobile/src/router/config.js 100.00% <100.00%> (ø)
... and 31 more

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cryptoBeliever

cryptoBeliever commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@OlegMakarenko Here are my findings. Let me know if you'd like me to create separate issues for any of them.

Mosaic management — findings

  1. Mosaic disappears once the creator holds none of it, taking Modify/Revoke with it. Steps:
    A. Create a mosaic with the revocable and supply-mutable flags.
    B. Distribute the entire supply to other accounts.
    C. Open Assets.

Actual — The mosaic is gone from the list. There is no way to reach its details screen, and therefore no way to use Modify Mosaic or Revoke Mosaic. The creator loses control of the mosaic (mosaic modification and revocation). The question if we want to improve that.

====

  1. App crashes after sending out the full balance and refreshing the details screen. Steps:
    A. Go to Assets.
    B. Open any mosaic.
    C. Tap Send.
    D. Send the entire balance you hold of that mosaic to another address.
    E. Confirm, wait for the transaction to be confirmed, tap OK.
    F. Pull down to refresh the details view.

Actual - The app crashes.

====

  1. Supply and divisibility are hidden from non-creator accounts - intended? Steps:
    A. From an account that holds a mosaic it did not create, open the mosaic details.

Actual — The information table shows only the ID, chain and creator. Supply and divisibility are omitted; they appear only when the viewing account is the creator.
Question — Is this expected? Both values are public on-chain data.

====

  1. Revoke screen shows a bare empty list when nobody else holds the mosaic. Steps
    A. Open a revocable mosaic whose entire supply is still held by the creator.
    B. Tap Revoke Mosaic.

Actual — The account selector is empty with no explanation. Maybe we can add some explanation?

====

  1. Wallet accepts a total supply the network rejects. Steps:
    A. Open Create Mosaic.
    B. Set divisibility = 6.
    C. Set total supply = 9000000000000000.
    D. Submit.

Actual — The wallet accepts the value and lets the transaction be sent; the network rejects it.
Expected — Local validation rejects any supply the network will not accept, before the user pays a fee for a failing transaction.

The hardcoded cap does not match the network. The wallet caps supply with MOSAIC_MAX_ATOMIC_UNITS = '9000000000000000' (9 × 10¹⁵) in src/screens/mosaic/constants/index.js:30. Symbol's actual network setting is maxMosaicAtomicUnits = 8999999999000000 — 1,000,000 atomic units lower. At divisibility 6 this means the wallet permits a total supply of up to 9,000,000,000 while the chain caps it at 8,999,999,999, so values in that gap are accepted locally and rejected on-chain at every divisibility level.

====

  1. [wallet/symbol/mobile] Inconsistent naming: "Token" vs "Mosaic" in the UI - intentional? #2442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants