Skip to content

Comments

Add sponsor-rent-top-ups toolkit#28

Open
tilo-14 wants to merge 1 commit intomainfrom
sponsor-rent-top-ups
Open

Add sponsor-rent-top-ups toolkit#28
tilo-14 wants to merge 1 commit intomainfrom
sponsor-rent-top-ups

Conversation

@tilo-14
Copy link
Contributor

@tilo-14 tilo-14 commented Feb 23, 2026

Summary

  • Add TypeScript and Rust examples for rent top-up sponsorship (fee payer covers rent-exemption so users hold no SOL)
  • Rewrite README for clarity and consistency with other toolkit READMEs
  • Fix dead-code crash in setup.ts — module-scope createRpc() call fired on import before the symbol was available
  • Add toolkit entry to toolkits/README.md

Test plan

  • Localnet: npm run sponsor-top-ups passes (light test-validator without --skip-system-accounts)
  • Devnet: requires Helius API key — skipped

Open with Devin

TypeScript and Rust examples showing rent top-up sponsorship
where a fee payer covers rent-exemption so users hold no SOL.

Fix dead-code crash in setup.ts (module-scope createRpc() call
that fired on import before the symbol was available).
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +9 to +12
"dependencies": {
"@lightprotocol/compressed-token": "^0.23.0-beta.9",
"@lightprotocol/stateless.js": "^0.23.0-beta.9"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🔴 Missing workspace entry causes unresolvable dependencies at install time

The new toolkits/sponsor-rent-top-ups/typescript package is not added to the root package.json workspaces array, unlike every other toolkit (e.g. toolkits/payments-and-wallets, toolkits/sign-with-privy/*). This means npm install from the repo root will not link this package into the workspace and will not hoist shared dependencies to it.

Root cause and impact

The root package.json lists shared dependencies (dotenv, @solana/web3.js, @solana/spl-token) and devDependencies (tsx) that all workspace toolkits rely on via hoisting. The existing toolkits/payments-and-wallets works because it's listed in workspaces and inherits these.

The new toolkit's own package.json only declares @lightprotocol/compressed-token and @lightprotocol/stateless.js, but the code imports:

  • dotenv/config (sponsor-top-ups.ts:1)
  • @solana/web3.js (sponsor-top-ups.ts:2, setup.ts:6)
  • @solana/spl-token (setup.ts:14-18)

And the npm script uses tsx (package.json:7).

Without the workspace entry, running npm install at the root won't set up this package, and running cd typescript && npm install standalone will only install the two declared @lightprotocol packages. The import "dotenv/config" at sponsor-top-ups.ts:1 will crash immediately with ERR_MODULE_NOT_FOUND, and npm run sponsor-top-ups will fail with tsx: command not found.

Impact: The toolkit is broken out of the box for anyone following the README instructions (cd typescript && npm install && npm run sponsor-top-ups).

Prompt for agents
Two changes are needed to fix this:

1. In the root package.json, add the new toolkit to the workspaces array. Around line 6, add "toolkits/sponsor-rent-top-ups/typescript" to the workspaces list, e.g.:
   "workspaces": [
       "typescript-client",
       "toolkits/payments-and-wallets",
       "toolkits/sign-with-privy/react",
       "toolkits/sign-with-privy/nodejs",
       "toolkits/sign-with-privy/scripts",
       "toolkits/sponsor-rent-top-ups/typescript"
   ]

This matches the pattern used by all other toolkits and ensures hoisted dependencies (dotenv, tsx, @solana/web3.js, @solana/spl-token) are available.

Alternatively, if standalone usage is intended, add the missing dependencies to toolkits/sponsor-rent-top-ups/typescript/package.json:
   "dependencies": {
       "@lightprotocol/compressed-token": "^0.23.0-beta.9",
       "@lightprotocol/stateless.js": "^0.23.0-beta.9",
       "@solana/web3.js": "1.98.4",
       "@solana/spl-token": "^0.4.13",
       "dotenv": "^16.5.0"
   },
   "devDependencies": {
       "tsx": "^4.7.0"
   }
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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