TON-1658: tonapi support in minter#478
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughTwo configuration files in ChangesDynamic TonAPI/Toncenter Provider Selection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/appkit-minter/src/core/configs/app-kit.ts (1)
56-67: 💤 Low valueRedundant truthiness check on API keys.
Since
ENV_TON_API_KEY_MAINNETandENV_TON_API_KEY_TESTNETboth have hardcoded default values inenv.ts, the(ENV_TON_API_KEY_MAINNET || ENV_TON_API_KEY_TESTNET)condition is always truthy. The effective condition is justuseTonApi.Consider simplifying or updating the comment to reflect the actual intent—if it's meant to guard against explicitly empty keys overriding the defaults, the current check won't catch that either.
♻️ Suggested simplification
-const gaslessConfig = - useTonApi && (ENV_TON_API_KEY_MAINNET || ENV_TON_API_KEY_TESTNET) - ? { +const gaslessConfig = useTonApi + ? { chains: { [Network.mainnet().chainId]: { apiKey: ENV_TON_API_KEY_MAINNET }, [Network.testnet().chainId]: { apiKey: ENV_TON_API_KEY_TESTNET }, }, } - : undefined; + : undefined;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/appkit-minter/src/core/configs/app-kit.ts` around lines 56 - 67, The gaslessConfig assignment in the app-kit.ts file contains a redundant truthiness check on ENV_TON_API_KEY_MAINNET and ENV_TON_API_KEY_TESTNET. Since these environment variables have hardcoded default values in env.ts, they are always truthy, making the (ENV_TON_API_KEY_MAINNET || ENV_TON_API_KEY_TESTNET) condition redundant. Simplify the conditional logic to just check useTonApi, since that is the only meaningful condition. If there is a specific intent to handle explicitly empty keys differently, clarify this in the comment or adjust the logic accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/appkit-minter/src/core/configs/app-kit.ts`:
- Around line 56-67: The gaslessConfig assignment in the app-kit.ts file
contains a redundant truthiness check on ENV_TON_API_KEY_MAINNET and
ENV_TON_API_KEY_TESTNET. Since these environment variables have hardcoded
default values in env.ts, they are always truthy, making the
(ENV_TON_API_KEY_MAINNET || ENV_TON_API_KEY_TESTNET) condition redundant.
Simplify the conditional logic to just check useTonApi, since that is the only
meaningful condition. If there is a specific intent to handle explicitly empty
keys differently, clarify this in the comment or adjust the logic accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 49281bd1-8d0c-40b6-8233-9576d14fb2fd
📒 Files selected for processing (2)
apps/appkit-minter/src/core/configs/app-kit.tsapps/appkit-minter/src/core/configs/env.ts
…
Summary by CodeRabbit
Release Notes
New Features
Chores