Skip to content

feat: upgrade @solana/subscriptions to 0.4.0-rc.2 + devnet/network switching - #2

Open
avneesh0612 wants to merge 3 commits into
mainfrom
feat/keychain-encrypted-key-shares
Open

feat: upgrade @solana/subscriptions to 0.4.0-rc.2 + devnet/network switching#2
avneesh0612 wants to merge 3 commits into
mainfrom
feat/keychain-encrypted-key-shares

Conversation

@avneesh0612

Copy link
Copy Markdown
Collaborator

Summary

  • SDK upgrade: @solana/subscriptions bumped from 0.2.0 → 0.4.0-rc.2 to match the Solana Foundation's deployed devnet program (rc.1 was hitting a 0x67 PDA derivation error on subscribe)
  • Subscribe fix: Split SubscriptionAuthority init into a separate transaction so the on-chain initId can be fetched before building the subscribe instruction — required by rc.1+ (expectedSubscriptionAuthorityInitId must be passed explicitly)
  • Network switching: Added pnpm subs network [devnet|mainnet] command that writes the chosen RPC URL to .env and persists across commands; SKILL.md updated so Claude knows to call it when the user says "use devnet"

Test plan

  • pnpm subs balance — wallet shows SOL + USDC on devnet
  • pnpm subs list-plans <merchant> — returns existing plan
  • pnpm subs subscribe <merchant> 0previously failing with 0x67, now succeeds
  • pnpm subs subs — subscription shows as active
  • pnpm subs collect <plan> <sub> <delegator> 5 — payment collected
  • pnpm subs cancel <plan> <sub> — cancellation queued
  • pnpm subs network devnet / pnpm subs network mainnet — switches RPC and prints confirmation

🤖 Generated with Claude Code

avneesh0612 and others added 3 commits May 30, 2026 02:13
Secure the MPC key share and other sensitive secrets instead of keeping
them as plaintext in .env:

- Encrypt the key share with AES-256-GCM (PBKDF2-SHA256, 600k iterations,
  unique salt/IV, authenticated). Stored as `enc:v1:…` envelope.
- Store sensitive secrets (key share, API token, WALLET_BACKUP_PASSWORD)
  in the macOS Keychain when available; .env keeps only non-sensitive
  config. Falls back to .env off-macOS.
- Per-session keystore passphrase: SUBS_KEYSTORE_PASSPHRASE is never
  stored — read from the env var or an interactive hidden prompt — so a
  Keychain compromise alone can't decrypt the share.
- setup now enables backUpToDynamic with WALLET_BACKUP_PASSWORD
  (auto-generated if unset) for recovery.
- New commands: `secrets` (migrate .env secrets into the Keychain) and
  `encrypt-shares` (encrypt a share created without a passphrase).
- Docs (SKILL.md, README.md, .env.example) updated; removed dead
  MERCHANT_ADDRESS config and a stale error-table row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Out of scope for this local skill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…itching

- Bump @solana/subscriptions 0.2.0 → 0.4.0-rc.2 (matches deployed devnet program)
- Split SubscriptionAuthority init into a separate tx so the real on-chain
  initId can be read before building the subscribe instruction (required by rc.1+)
- Pass expectedSubscriptionAuthorityInitId from fetched authority account
- Add `pnpm subs network [devnet|mainnet]` command to switch RPC and persist to .env
- Add network switching section to SKILL.md so Claude knows when to call it
- Pre-emptively await getUpdatePlanOverlayInstruction in cmdSunsetPlan for rc.2 compat

Tested full lifecycle on devnet: list-plans → subscribe → subs → collect → cancel. All green.

Co-Authored-By: Claude Sonnet 4.6 <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