Feat: WalletKit Gram#463
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughRenames the native asset from TON to GRAM across the ChangesTON → GRAM rename
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/walletkit/src/core/JettonsManager.ts (1)
25-25: ⚡ Quick winConsider adding a clarifying comment for GRAM_ADDRESS.
The constant name
GRAM_ADDRESSwith value'TON'may be confusing to future developers. Since'TON'is the internal identifier andGRAMis the display name/symbol, a comment explaining this distinction would improve clarity.📝 Suggested comment
-const GRAM_ADDRESS = 'TON'; +// Internal identifier for the native asset (value 'TON' is the on-chain identifier; 'GRAM' is the display name) +const GRAM_ADDRESS = 'TON';🤖 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 `@packages/walletkit/src/core/JettonsManager.ts` at line 25, Add a clarifying comment above the GRAM_ADDRESS constant definition to explain that 'TON' is the internal blockchain identifier while GRAM is the display name or symbol used in the user interface. This will help future developers understand why the constant is named GRAM_ADDRESS but has the value 'TON', reducing potential confusion about the distinction between the internal identifier and the display symbol.
🤖 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.
Inline comments:
In @.changeset/rename-ton-to-gram.md:
- Line 2: The version bump declaration in the changeset is set to patch, but the
actual changes being made (removing the exported HumanReadableTx type and
renaming the isValidNanoAmount function) are breaking changes that require a
major version bump according to semantic versioning. Change the version bump
type from patch to major in the changeset file to accurately reflect the
breaking nature of these changes.
In `@packages/walletkit/src/defi/staking/tonstakers/PoolContract.ts`:
- Around line 17-24: Update the JSDoc comments for the PoolData interface fields
to reflect the asset name rename from TON to GRAM. In the PoolContract.ts file,
modify the documentation comments for the totalBalance, supply,
projectedBalance, and projectedSupply fields to replace references to "TON" and
"tsTON" with the appropriate new asset names (GRAM and corresponding staking
token names) to ensure the generated API documentation reflects the current
naming convention across the package.
---
Nitpick comments:
In `@packages/walletkit/src/core/JettonsManager.ts`:
- Line 25: Add a clarifying comment above the GRAM_ADDRESS constant definition
to explain that 'TON' is the internal blockchain identifier while GRAM is the
display name or symbol used in the user interface. This will help future
developers understand why the constant is named GRAM_ADDRESS but has the value
'TON', reducing potential confusion about the distinction between the internal
identifier and the display symbol.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 421540a9-20e1-4a18-ae15-79d7ae06f104
⛔ Files ignored due to path filters (1)
packages/walletkit/src/types/toncenter/__snapshots__/AccountEvent.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (56)
.changeset/rename-ton-to-gram.mddemo/examples/src/__tests__/transfers.test.tsdemo/examples/src/__tests__/ui.test.tsdemo/examples/src/appkit/swap/dedust.tsdemo/examples/src/appkit/swap/omniston.tsdemo/examples/src/send-nft.tsdemo/examples/src/send-ton.tsdemo/examples/src/ui/render-money-flow.tsxdemo/examples/src/ui/summarize-transaction.tsxpackages/walletkit/DEVELOPMENT.mdpackages/walletkit/README.mdpackages/walletkit/examples/js-bridge-usage.mdpackages/walletkit/examples/ledger-usage.mdpackages/walletkit/src/api/interfaces/GaslessAPI.tspackages/walletkit/src/api/models/blockchain/AccountState.tspackages/walletkit/src/api/models/core/AssetType.tspackages/walletkit/src/api/models/core/TokenAmount.tspackages/walletkit/src/api/models/core/TokenInfo.tspackages/walletkit/src/api/models/emulation/EmulationMessage.tspackages/walletkit/src/api/models/emulation/EmulationTransaction.tspackages/walletkit/src/api/models/gasless/GaslessConfig.tspackages/walletkit/src/api/models/jettons/JettonsTransferRequest.tspackages/walletkit/src/api/models/nfts/NFTRawTransferRequest.tspackages/walletkit/src/api/models/nfts/NFTTransferRequest.tspackages/walletkit/src/api/models/staking/StakeParams.tspackages/walletkit/src/api/models/staking/StakingProviderInfo.tspackages/walletkit/src/api/models/staking/StakingProviderMetadata.tspackages/walletkit/src/api/models/staking/StakingQuoteParams.tspackages/walletkit/src/api/models/tons/TONTransferRequest.tspackages/walletkit/src/api/models/transactions/Transaction.tspackages/walletkit/src/api/models/transactions/TransactionTrace.tspackages/walletkit/src/api/models/transactions/TransactionTraceMoneyFlow.tspackages/walletkit/src/clients/tonapi/mappers/map-emulation.tspackages/walletkit/src/core/JettonsManager.tspackages/walletkit/src/core/wallet/extensions/ton.tspackages/walletkit/src/defi/gasless/README.mdpackages/walletkit/src/defi/staking/StakingManager.tspackages/walletkit/src/defi/staking/tonstakers/PoolContract.tspackages/walletkit/src/defi/staking/tonstakers/README.mdpackages/walletkit/src/defi/staking/tonstakers/TonStakersStakingProvider.spec.tspackages/walletkit/src/defi/staking/tonstakers/TonStakersStakingProvider.tspackages/walletkit/src/defi/staking/tonstakers/constants.tspackages/walletkit/src/defi/swap/dedust/README.mdpackages/walletkit/src/defi/swap/dedust/utils.tspackages/walletkit/src/defi/swap/omniston/OmnistonSwapProvider.spec.tspackages/walletkit/src/defi/swap/omniston/README.mdpackages/walletkit/src/types/index.tspackages/walletkit/src/types/toncenter/parsers/Contract.tspackages/walletkit/src/types/toncenter/parsers/TonTransfer.tspackages/walletkit/src/utils/computeMoneyFlow.tspackages/walletkit/src/utils/messageBuilders.tspackages/walletkit/src/validation/index.tspackages/walletkit/src/validation/transaction.tspackages/walletkit/src/validation/wallet.tstemplate/packages/walletkit/README.mdtemplate/packages/walletkit/src/defi/staking/tonstakers/README.md
💤 Files with no reviewable changes (1)
- packages/walletkit/src/types/index.ts
| @@ -0,0 +1,11 @@ | |||
| --- | |||
| "@ton/walletkit": patch | |||
There was a problem hiding this comment.
Semantic versioning violation: breaking changes require a major bump, not patch.
Line 2 declares a patch version bump, but the changeset removes the exported HumanReadableTx type and renames the public isValidNanoAmount function (both breaking changes for consumers). According to semantic versioning, breaking changes require a major version increment.
🔧 Proposed fix
---
-"`@ton/walletkit`": patch
+"`@ton/walletkit`": major
---📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "@ton/walletkit": patch | |
| "`@ton/walletkit`": major |
🤖 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 @.changeset/rename-ton-to-gram.md at line 2, The version bump declaration in
the changeset is set to patch, but the actual changes being made (removing the
exported HumanReadableTx type and renaming the isValidNanoAmount function) are
breaking changes that require a major version bump according to semantic
versioning. Change the version bump type from patch to major in the changeset
file to accurately reflect the breaking nature of these changes.
| /** Total TON balance in the pool (nano units) */ | ||
| totalBalance: bigint; | ||
| /** Total tsTON supply (nanotsTON) */ | ||
| /** Total tsTON supply (nano units) */ | ||
| supply: bigint; | ||
| /** Projected TON balance at round end (nanoTON) */ | ||
| /** Projected TON balance at round end (nano units) */ | ||
| projectedBalance: bigint; | ||
| /** Projected tsTON supply at round end (nanotsTON) */ | ||
| /** Projected tsTON supply at round end (nano units) */ | ||
| projectedSupply: bigint; |
There was a problem hiding this comment.
Align the PoolData docs with the GRAM rename.
These public comments still describe the pool totals in TON, which will leak the old asset name into generated API docs and conflict with the rest of the package rename.
Suggested wording update
- /** Total TON balance in the pool (nano units) */
+ /** Total GRAM balance in the pool (nano units) */
- /** Total tsTON supply (nano units) */
+ /** Total tsTON supply (nano units) */
- /** Projected TON balance at round end (nano units) */
+ /** Projected GRAM balance at round end (nano units) */
- /** Projected tsTON supply at round end (nano units) */
+ /** Projected tsTON supply at round end (nano units) */📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /** Total TON balance in the pool (nano units) */ | |
| totalBalance: bigint; | |
| /** Total tsTON supply (nanotsTON) */ | |
| /** Total tsTON supply (nano units) */ | |
| supply: bigint; | |
| /** Projected TON balance at round end (nanoTON) */ | |
| /** Projected TON balance at round end (nano units) */ | |
| projectedBalance: bigint; | |
| /** Projected tsTON supply at round end (nanotsTON) */ | |
| /** Projected tsTON supply at round end (nano units) */ | |
| projectedSupply: bigint; | |
| /** Total GRAM balance in the pool (nano units) */ | |
| totalBalance: bigint; | |
| /** Total tsTON supply (nano units) */ | |
| supply: bigint; | |
| /** Projected GRAM balance at round end (nano units) */ | |
| projectedBalance: bigint; | |
| /** Projected tsTON supply at round end (nano units) */ | |
| projectedSupply: bigint; |
🤖 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 `@packages/walletkit/src/defi/staking/tonstakers/PoolContract.ts` around lines
17 - 24, Update the JSDoc comments for the PoolData interface fields to reflect
the asset name rename from TON to GRAM. In the PoolContract.ts file, modify the
documentation comments for the totalBalance, supply, projectedBalance, and
projectedSupply fields to replace references to "TON" and "tsTON" with the
appropriate new asset names (GRAM and corresponding staking token names) to
ensure the generated API documentation reflects the current naming convention
across the package.
Summary by CodeRabbit
name: 'Gram'andsymbol: 'GRAM'stakeToken.ticker: 'GRAM'HumanReadableTxtype removed from public exports