Skip to content

Remove SPK Network support#3319

Merged
feruzm merged 5 commits into
developmentfrom
feature/remove-spk-support
Jul 2, 2026
Merged

Remove SPK Network support#3319
feruzm merged 5 commits into
developmentfrom
feature/remove-spk-support

Conversation

@feruzm

@feruzm feruzm commented Jul 2, 2026

Copy link
Copy Markdown
Member

Removes the SPK Network token layer (SPK / LARYNX / LP) from the app, companion to the vision-next removal (ecency/vision-next#1063, merged).

Removed

  • providers/hive-spk (SPK node client, wallet/markets fetchers, custom_json builders)
  • SDK mutation wrappers (useTransferSpkMutation, useTransferLarynxMutation, usePowerLarynxMutation, useLockLarynxMutation)
  • SPK transfer types and branches in transferContainer, transferScreen, useTransferMutations, transactionOpsBuilder
  • ASSET_IDS.SPK/LARYNX/LARYNX_POWER, TokenLayers.SPK, TokenType.SPK, isSpk plumbing across wallet/assets screens and asset icon badge
  • 20 SPK locale keys from all locale files
  • hive_spk.png asset

Data hygiene

  • redux-persist migration v19 purges persisted SPK assets from wallet.selectedAssets (persist version 18 → 19)
  • Profile token reads (walletScreen, assetsSelect) now filter stale type: 'SPK' entries from on-chain posting_json_metadata, so old profiles self-heal
  • Fixes a latent bug in migrationHelpers: TokenType/ProfileToken were imported from a module that doesn't export them, which broke the legacy token-format migration at runtime

Dependencies

  • @ecency/sdk bumped ^2.3.28 → ^2.3.32: SPK-free SDK plus the latest REST-node configuration and rate-limit backoff improvements

Untouched

  • 3Speak video features, including the editor's allowSpkPublishing gate (video publishing state, unrelated to the token layer)

jest green (469 tests) and lint clean on the bumped SDK.

Summary by CodeRabbit

  • Chores
    • Updated a core SDK dependency to a newer version, bringing the latest improvements and fixes.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f39bde4-553d-4792-8a36-b8398678847e

📥 Commits

Reviewing files that changed from the base of the PR and between c2e8709 and dc13bec.

📒 Files selected for processing (2)
  • src/utils/migrationHelpers.test.ts
  • src/utils/migrationHelpers.ts
📝 Walkthrough

Walkthrough

package.json updates the @ecency/sdk dependency from ^2.3.28 to ^2.3.32.

Changes

SDK dependency update

Layer / File(s) Summary
Dependency version bump
package.json
@ecency/sdk is updated in dependencies from ^2.3.28 to ^2.3.32.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related PRs

  • ecency/ecency-mobile#3223: Also bumps @ecency/sdk in package.json, so it is directly related at the dependency update level.

Poem

A tiny hop, a version nudge,
The SDK takes one more judge.
🐇 I sniff the yarn, then bound along,
And keep the app’s old rhythm strong.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title says SPK Network support is removed, but the summarized change only bumps @ecency/sdk in package.json. Rename it to reflect the actual change, or include the SPK removal changes in the summarized diff.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/remove-spk-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 451e5dbede

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 46 to 47
isEngine: (asset as SelectableAsset).isEngine ?? base.layer === 'engine',
isSpk: (asset as SelectableAsset).isSpk ?? base.layer === 'spk',
isChain: (asset as SelectableAsset).isChain ?? base.layer === 'chain',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Filter SDK SPK assets out of the picker

Because @ecency/sdk is still pinned to the SPK-enabled 2.3.28 release and useAssetsQuery({ onlyEnabled: false }) does not filter data.wallets, SPK/LARYNX items with layer: 'spk' can still arrive in assetsQuery.selectedableData. After this change mapAssetLayer no longer marks them as SPK or excludes them, so they remain selectable as generic assets; applying the picker writes them into Redux selected assets, where the now-removed SPK transfer/action paths only fail. Please drop layer === 'spk' assets at this boundary until the SDK is bumped or filtered upstream.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Resolved by c2e8709: @ecency/sdk is bumped to ^2.3.32 in this PR. That release's getPortfolioQueryOptions filters out layer: 'spk' rows client-side, and the portfolio endpoint no longer returns SPK entries, so they can't reach selectedableData.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes all SPK Network token-layer support (SPK / LARYNX / LP) from the mobile app and adds the data-hygiene machinery needed to keep existing users in a clean state. It is a companion to the already-merged vision-next removal.

  • SPK code removed end-to-end: providers (hive-spk), SDK mutations (useTransferSpkMutation et al.), transfer types, TokenLayers.SPK, TokenType.SPK, AssetBase.isSpk, asset-icon badges, and 20 locale keys across all 45 locale files are deleted; @ecency/sdk is bumped to ^2.3.32.
  • Redux migration v19 purges persisted SPK/LARYNX/LP entries from wallet.selectedAssets, with engine-token exemption logic (a Hive Engine token carrying one of those symbols is not purged). Display-layer guards in walletScreen and assetsSelect filter stale type: 'SPK' profile tokens so old on-chain posting_json_metadata self-heals without requiring a write.
  • Latent import bug fixed: migrationHelpers.ts was importing TokenType/ProfileToken from assetsSelect.tsx (which only exports a default component), causing those symbols to resolve as undefined at runtime; the import is corrected to walletReducer.ts where they are genuinely exported.

Confidence Score: 5/5

Safe to merge — the removal is consistent end-to-end, the redux migration is guarded and tested, and the latent TokenType import bug is fixed.

All SPK call sites are removed cleanly, the persist-version bump triggers v19 on first launch, engine tokens sharing SPK-colliding symbols are correctly exempted, and the fix that corrects the broken TokenType import from assetsSelect.tsx to walletReducer.ts resolves a real runtime breakage in the legacy token migration path. Tests cover the new migration and the updated object-to-array conversion path.

src/utils/migrationHelpers.ts — the array-format branch of migrateSelectedTokens does not filter SPK entries, so a user whose posting_json_metadata was already in array form will retain stale SPK tokens there until their next explicit profile save (display guards prevent them from appearing, but the metadata stays dirty in the interim).

Important Files Changed

Filename Overview
src/utils/migrationHelpers.ts Adds redux migration v19 to purge SPK assets from persisted state; fixes the TokenType/ProfileToken import to walletReducer; the array-format path of migrateSelectedTokens still doesn't drop SPK entries but display guards prevent them from appearing
src/utils/migrationHelpers.test.ts Adds v19 migration tests covering the purge, engine-token exemption, missing selectedAssets, and absent wallet slice; removes the mock that was papering over the broken TokenType import
src/redux/store/store.ts Bumps persist version from 18 to 19 to trigger the SPK-purge migration on first app launch after upgrade
src/redux/reducers/walletReducer.ts Removes TokenType.SPK and AssetBase.isSpk/CoinData.isSpk fields; TokenType and ProfileToken now correctly serve as the canonical export point for these types
src/screens/assetsSelect/screen/assetsSelect.tsx Drops isSpk plumbing throughout; adds String(token.type) !== 'SPK' guard to prevent stale on-chain SPK profile entries from appearing in the asset selector
src/screens/wallet/screen/walletScreen.tsx Removes isSpk mapping; adds SPK type guard to populateSelectedAssets so legacy metadata entries are silently dropped until the user's next profile save
src/containers/transferContainer.ts Removes the SPK layer dispatch branch and spkMarkets state; all remaining transfer paths (HIVE, ENGINE, POINTS, CHAIN) are intact
src/screens/transfer/screen/transferScreen.tsx Removes SPK-specific recipient dropdown and Keychain SPK signing path; simplifies the recipient input to a single TextInput path for all remaining transfer types
src/hooks/useTransferMutations.ts Removes four SPK mutation hooks (transferSpk, transferLarynx, powerLarynx, delegateLarynx) and the toMilliUnits import; remaining mutation bundle is intact
src/providers/hive-spk/hiveSpk.ts Entire SPK node client deleted; all call sites in transferScreen, transactionOpsBuilder, and transferContainer have been updated to remove their references

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App launch after upgrade] --> B{persist version < 19?}
    B -- yes --> C[Migration v19 runs]
    B -- no --> G[Normal startup]
    C --> D["Filter wallet.selectedAssets:\n!isSpk AND (isEngine OR symbol not in SPK/LARYNX/LP)"]
    D --> E[SPK/LARYNX/LP assets purged]
    D --> F[Engine LP tokens and non-SPK assets kept]
    E --> G
    G --> H[walletScreen loads profile tokens]
    H --> I{"token.type === 'SPK'?"}
    I -- yes --> J[Token dropped from display]
    I -- no --> K[Token shown in wallet]
    G --> L[assetsSelect loads profile tokens]
    L --> M{"String(type) === 'SPK'?"}
    M -- yes --> N[Token excluded from selection list]
    M -- no --> O[Token shown for selection]
    O --> P[User saves - SPK entries never written back]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[App launch after upgrade] --> B{persist version < 19?}
    B -- yes --> C[Migration v19 runs]
    B -- no --> G[Normal startup]
    C --> D["Filter wallet.selectedAssets:\n!isSpk AND (isEngine OR symbol not in SPK/LARYNX/LP)"]
    D --> E[SPK/LARYNX/LP assets purged]
    D --> F[Engine LP tokens and non-SPK assets kept]
    E --> G
    G --> H[walletScreen loads profile tokens]
    H --> I{"token.type === 'SPK'?"}
    I -- yes --> J[Token dropped from display]
    I -- no --> K[Token shown in wallet]
    G --> L[assetsSelect loads profile tokens]
    L --> M{"String(type) === 'SPK'?"}
    M -- yes --> N[Token excluded from selection list]
    M -- no --> O[Token shown for selection]
    O --> P[User saves - SPK entries never written back]
Loading

Reviews (3): Last reviewed commit: "exempt engine tokens from v19 SPK symbol..." | Re-trigger Greptile

Comment thread src/utils/migrationHelpers.ts Outdated
@feruzm feruzm merged commit 069e34d into development Jul 2, 2026
11 of 13 checks passed
@feruzm feruzm deleted the feature/remove-spk-support branch July 2, 2026 13:14
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.

1 participant