fix(DEV-3792): make warmupCooldownRate optional; deprecate legacy Solana duplicate - #149
Open
vhrabovskyi-sudo wants to merge 3 commits into
Open
fix(DEV-3792): make warmupCooldownRate optional; deprecate legacy Solana duplicate#149vhrabovskyi-sudo wants to merge 3 commits into
vhrabovskyi-sudo wants to merge 3 commits into
Conversation
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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Current Agave
jsonParsedstake-account RPC responses omitdelegation.warmupCooldownRate, butsolana_v1's stake-account schema declared it as required, causingParseStakeAccountErroringetDelegations-based balance reads,unstake(), andclaim(). While mirroring that fix into the root@everstake/wallet-sdkpackage, it became clearsrc/solana/was a hand-copied duplicate ofsolana_v1that 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
delegation.warmupCooldownRateoptional insolana_v1's stake-account schema — no default value; staysundefinedif the RPC omits it. The field is validation-only and never read by any SDK business logic.StakeAccountparses with/without the field, a genuinely-required field (voter) still throwsParseStakeAccountError, andunstake()/claim()succeed with equivalent output when the field is missing.Refactor
src/solana/entirely from the root@everstake/wallet-sdkpackage — it was a hand-copied duplicate ofsolana_v1, not shared code, and had already drifted (missing the min-amount check instake(), stale 0.01 SOL minimum vs.solana_v1's 1 SOL from feat(solana): raise min stake threshold to 1 SOL #144, and this samewarmupCooldownRatebug).@everstake/wallet-sdknow only re-exports the shared, chain-agnostic API helpers (CheckToken,SetStats,CreateToken,GetAssets,Blockchain,WalletSDKError) that have no blockchain SDK dependency of their own.@solana/web3.js,bignumber.js,ethereum-multicall,superstruct,web3.package.jsondescription/keywords to reflect deprecation; updateREADME.md/CLAUDE.md/CODEBASE.md(the README'sEthereum/Solanaimport example was already stale —Ethereumdidn't even exist insrc/anymore) to point consumers at the per-chain packages.Versioning
@everstake/wallet-sdk(root package) from1.0.20to2.0.0. Removingsrc/solana/'s exports (theSolanaclass,stakeAccountexports, 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 — thewarmupCooldownRatefix ships in its own next patch release.Nothing is published yet. Registry-level
npm deprecatefor@everstake/wallet-sdkis 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