Skip to content

fix(DEV-3792): make warmupCooldownRate optional; deprecate legacy Solana duplicate - #149

Open
vhrabovskyi-sudo wants to merge 3 commits into
mainfrom
fix/DEV-3792/solana-update-library-version
Open

fix(DEV-3792): make warmupCooldownRate optional; deprecate legacy Solana duplicate#149
vhrabovskyi-sudo wants to merge 3 commits into
mainfrom
fix/DEV-3792/solana-update-library-version

Conversation

@vhrabovskyi-sudo

@vhrabovskyi-sudo vhrabovskyi-sudo commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Current Agave jsonParsed stake-account RPC responses omit delegation.warmupCooldownRate, but solana_v1's stake-account schema declared it as required, causing ParseStakeAccountError in getDelegations-based balance reads, unstake(), and claim(). While mirroring that fix into the root @everstake/wallet-sdk package, it became clear src/solana/ was a hand-copied duplicate of solana_v1 that had already drifted (missing min-amount validation, stale minimum stake threshold). Since @everstake/wallet-sdk-solana (solana_v1) is the maintained replacement, this PR also removes the duplicated Solana implementation from the root package rather than patching a second copy of the same bug.

Changes

Fix

  • Make delegation.warmupCooldownRate optional in solana_v1's stake-account schema — no default value; stays undefined if the RPC omits it. The field is validation-only and never read by any SDK business logic.
  • Add regression tests: StakeAccount parses with/without the field, a genuinely-required field (voter) still throws ParseStakeAccountError, and unstake()/claim() succeed with equivalent output when the field is missing.

Refactor

  • Remove src/solana/ entirely from the root @everstake/wallet-sdk package — it was a hand-copied duplicate of solana_v1, not shared code, and had already drifted (missing the min-amount check in stake(), stale 0.01 SOL minimum vs. solana_v1's 1 SOL from feat(solana): raise min stake threshold to 1 SOL #144, and this same warmupCooldownRate bug).
  • @everstake/wallet-sdk now only re-exports the shared, chain-agnostic API helpers (CheckToken, SetStats, CreateToken, GetAssets, Blockchain, WalletSDKError) that have no blockchain SDK dependency of their own.
  • Drop now-unused dependencies: @solana/web3.js, bignumber.js, ethereum-multicall, superstruct, web3.
  • Update package.json description/keywords to reflect deprecation; update README.md/CLAUDE.md/CODEBASE.md (the README's Ethereum/Solana import example was already stale — Ethereum didn't even exist in src/ anymore) to point consumers at the per-chain packages.
  • Add a smoke test confirming the surviving exports are real.

Versioning

  • Bump @everstake/wallet-sdk (root package) from 1.0.20 to 2.0.0. Removing src/solana/'s exports (the Solana class, stakeAccount exports, Solana constants/types) from the package's public API is a breaking change for any consumer importing Solana from the root package, so this is a major bump per semver.
  • @everstake/wallet-sdk-solana (solana_v1)'s version is unchanged in this PR — the warmupCooldownRate fix ships in its own next patch release.

Nothing is published yet. Registry-level npm deprecate for @everstake/wallet-sdk is a separate, deliberate release action left for a future step.

Commits

674e5af refactor(wallet-sdk): deprecate legacy Solana implementation
32eef4a fix(solana_v1): make delegation.warmupCooldownRate optional
98200e5 chore(wallet-sdk)!: bump version to 2.0.0

Current Agave `jsonParsed` stake-account RPC responses omit
delegation.warmupCooldownRate, but the v1 stake-account schema declared
it as required, causing ParseStakeAccountError in getDelegations-based
reads, unstake(), and claim(). The field is validation-only and is
never read by any SDK business logic, so relaxing it to optional (no
default value) is a safe, behavior-preserving fix.

Adds regression tests covering StakeAccount parsing with/without the
field, a genuinely-required-field (voter) still throwing, and
unstake()/claim() succeeding with equivalent output when the field is
missing. Test fixtures live in src/__tests__/testData.ts; jest.config
excludes it from testMatch since it contains no specs itself.
src/solana/ was a hand-copied duplicate of solana_v1, not shared code,
and had already drifted: it was missing the min-amount check on
stake(), still used the old 0.01 SOL minimum (solana_v1 bumped to 1
SOL in #144), and required the now-optional warmupCooldownRate field.

@everstake/wallet-sdk-solana (solana_v1) is the maintained replacement.
Remove src/solana/ entirely; @everstake/wallet-sdk now only re-exports
the shared, chain-agnostic API helpers (CheckToken, SetStats,
CreateToken, GetAssets, Blockchain, WalletSDKError) which have no
blockchain SDK dependency of their own.

- Drop @solana/web3.js, bignumber.js, ethereum-multicall, superstruct,
  and web3 from dependencies (all now unused)
- Update package.json description/keywords to reflect deprecation
- Update README/CLAUDE.md/CODEBASE.md: fix stale Ethereum/Solana import
  example, point consumers at the per-chain packages
- Add a smoke test asserting the surviving exports are real

Version not bumped; nothing published. Registry-level `npm deprecate`
is a separate, deliberate release action left for a future step.
@vhrabovskyi-sudo vhrabovskyi-sudo changed the title fix(DEV-3792): make delegation.warmupCooldownRate optional fix(DEV-3792): make warmupCooldownRate optional; deprecate legacy Solana duplicate Sep 7, 2026
The legacy Solana implementation was removed from the root
@everstake/wallet-sdk package's public exports in 674e5af, breaking
any consumer importing Solana from this package. Bump major version
per semver to reflect the breaking API removal; nothing published yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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