TON-1524: add fields for ton/jetton/nft transfer actions#470
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThree transfer transaction builders ( ChangesAdvanced Transfer Parameters
Sequence Diagram(s)sequenceDiagram
rect rgba(100, 149, 237, 0.5)
Note over Caller,storeJettonTransferMessage: Jetton Transfer
Caller->>createTransferJettonTransaction: amount, forwardPayload?, comment?, queryId?, gasAmount?
createTransferJettonTransaction->>getJettonWalletAddressFromClient: ownerAddress, jettonMasterAddress
getJettonWalletAddressFromClient-->>createTransferJettonTransaction: jettonWalletAddress
createTransferJettonTransaction->>storeJettonTransferMessage: queryId, parsed amount, addresses, customPayload, forwardAmount, forwardPayloadCell
storeJettonTransferMessage-->>createTransferJettonTransaction: Cell
createTransferJettonTransaction-->>Caller: messages[{address, amount: gasAmount, payload}], fromAddress
end
rect rgba(60, 179, 113, 0.5)
Note over Caller,storeNftTransferMessage: NFT Transfer
Caller->>createTransferNftTransaction: nftAddress, recipientAddress, forwardPayload?, comment?, gasAmount?, responseDestination?
createTransferNftTransaction->>storeNftTransferMessage: queryId, newOwner, responseDestination, customPayload, forwardAmount, forwardPayloadCell
storeNftTransferMessage-->>createTransferNftTransaction: Cell
createTransferNftTransaction-->>Caller: messages[{address, amount: gasAmount, payload}], fromAddress
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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.
Actionable comments posted: 1
🤖 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 `@packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts`:
- Around line 11-17: Replace direct imports from `@ton/walletkit` with imports
from local re-export modules to enforce consistent import boundaries. In
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts (lines
11-17), replace the imports of storeJettonTransferMessage, createCommentPayload,
getJettonWalletAddressFromClient, DEFAULT_JETTON_GAS_FEE,
DEFAULT_FORWARD_AMOUNT, and parseUnits with imports from a local jettons
re-export module. Create or update a re-export file (likely
packages/appkit/src/actions/jettons/index.ts or similar) that re-exports these
items from `@ton/walletkit`. In packages/appkit/src/types/transaction.ts (line
15), remove the direct re-export of ExtraCurrencies from `@ton/walletkit` and
instead import it from the local re-export module. In
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.test.ts
(line 11), update imports to consume these items from the local jettons
re-export module. In
packages/appkit/src/actions/nft/create-transfer-nft-transaction.ts (lines
10-15), replace direct `@ton/walletkit` imports with imports from a local nft
re-export module. In
packages/appkit/src/actions/nft/create-transfer-nft-transaction.test.ts (line
11), update imports to consume items from the local nft re-export module.
🪄 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: 5cc237f7-c45f-4eb5-8fdf-d33490603257
📒 Files selected for processing (8)
.changeset/transfer-advanced-params.mdpackages/appkit/src/actions/jettons/create-transfer-jetton-transaction.test.tspackages/appkit/src/actions/jettons/create-transfer-jetton-transaction.tspackages/appkit/src/actions/nft/create-transfer-nft-transaction.test.tspackages/appkit/src/actions/nft/create-transfer-nft-transaction.tspackages/appkit/src/actions/transaction/create-transfer-ton-transaction.test.tspackages/appkit/src/actions/transaction/create-transfer-ton-transaction.tspackages/appkit/src/types/transaction.ts
| storeJettonTransferMessage, | ||
| createCommentPayload, | ||
| getJettonWalletAddressFromClient, | ||
| DEFAULT_JETTON_GAS_FEE, | ||
| DEFAULT_FORWARD_AMOUNT, | ||
| parseUnits, | ||
| } from '@ton/walletkit'; |
There was a problem hiding this comment.
Route @ton/walletkit access through local AppKit re-export modules.
These changes add direct @ton/walletkit imports/re-exports inside packages/appkit/src/**, which breaks the import-boundary rule and creates inconsistent dependency direction across runtime and test code.
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts#L11-L17: replace direct imports with imports from a localsrc/<module>/index.tsre-export.packages/appkit/src/types/transaction.ts#L15-L15: exposeExtraCurrenciesvia the same local re-export boundary instead of re-exporting directly from@ton/walletkit.packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.test.ts#L11-L11: consume constants/functions through local re-exports, matching app code boundaries.packages/appkit/src/actions/nft/create-transfer-nft-transaction.ts#L10-L15: replace direct imports with local re-export imports.packages/appkit/src/actions/nft/create-transfer-nft-transaction.test.ts#L11-L11: replace direct imports with local re-export imports.
As per coding guidelines, "packages/appkit/src/**/*.{ts,tsx}: Never import from @ton/walletkit directly in appkit code. Instead, create re-export files under src/<module>/index.ts that re-export types and functions from @ton/walletkit."
📍 Affects 5 files
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts#L11-L17(this comment)packages/appkit/src/types/transaction.ts#L15-L15packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.test.ts#L11-L11packages/appkit/src/actions/nft/create-transfer-nft-transaction.ts#L10-L15packages/appkit/src/actions/nft/create-transfer-nft-transaction.test.ts#L11-L11
🤖 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/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts`
around lines 11 - 17, Replace direct imports from `@ton/walletkit` with imports
from local re-export modules to enforce consistent import boundaries. In
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.ts (lines
11-17), replace the imports of storeJettonTransferMessage, createCommentPayload,
getJettonWalletAddressFromClient, DEFAULT_JETTON_GAS_FEE,
DEFAULT_FORWARD_AMOUNT, and parseUnits with imports from a local jettons
re-export module. Create or update a re-export file (likely
packages/appkit/src/actions/jettons/index.ts or similar) that re-exports these
items from `@ton/walletkit`. In packages/appkit/src/types/transaction.ts (line
15), remove the direct re-export of ExtraCurrencies from `@ton/walletkit` and
instead import it from the local re-export module. In
packages/appkit/src/actions/jettons/create-transfer-jetton-transaction.test.ts
(line 11), update imports to consume these items from the local jettons
re-export module. In
packages/appkit/src/actions/nft/create-transfer-nft-transaction.ts (lines
10-15), replace direct `@ton/walletkit` imports with imports from a local nft
re-export module. In
packages/appkit/src/actions/nft/create-transfer-nft-transaction.test.ts (line
11), update imports to consume items from the local nft re-export module.
Source: Coding guidelines
Summary by CodeRabbit
New Features
amountparameter renamed togasAmountTests