feat: enable TON chain and Stonfi swapper#11842
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughEnvironment configuration files are updated to enable TON and STONFI_SWAP features in production, while removing these feature flags from the development environment configuration. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
gomesalexandre
left a comment
There was a problem hiding this comment.
Not sure about this in this state - we're missing ton assets in ton chain dropdown - including when searching https://jam.dev/c/3303821a-f6bf-4867-ad09-f9210b3e75d0
Taking a look into it now
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/utils/src/treasury.ts`:
- Line 42: The constant DAO_TREASURY_TON is set to the placeholder 'REPLACE_ME',
which will be returned by getTreasuryAddressFromChainId and used as
referrerAddress in Stonfi requests; replace the placeholder with the actual DAO
treasury TON address (the real TON wallet string confirmed in PR `#11841`) in the
DAO_TREASURY_TON export and verify getTreasuryAddressFromChainId resolves TON to
that value when VITE_FEATURE_TON and VITE_FEATURE_STONFI_SWAP are enabled so no
requests send the placeholder referrer.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Enables TON blockchain support and Stonfi swapper by moving feature flags from .env.development to .env: - Remove VITE_FEATURE_TON from .env.development - Remove VITE_FEATURE_STONFI_SWAP from .env.development - Enable VITE_FEATURE_TON=true in .env - Enable VITE_FEATURE_STONFI_SWAP=true in .env This activates: - TON blockchain support across the application - Stonfi DEX integration for TON swaps - Referral fee collection for ShapeShift DAO treasury 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
75f0d9e to
a4694a6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.env:
- Around line 312-313: Reorder the two dotenv keys so they follow
dotenv-linter's alphabetical ordering: place VITE_FEATURE_STONFI_SWAP before
VITE_FEATURE_TON in the .env entries; ensure no extra whitespace or duplicate
keys are introduced when swapping the lines.
|
FYI @NeOMakinG - stacked on top of #11889 |
gomesalexandre
left a comment
There was a problem hiding this comment.
Happy with this whenever base gets in
Also fixed both Jetton transfers in #11896 and failures in #11897 - should probably get at least the first one in release as well
Tested:
- TON sends ✅
- Jetton sends 🚫
- Jetton <-> Jetton swaps ✅
- TON <-> Jetton swaps ✅
- Second-class Tx history ✅
- Second-class balance updates ✅
- Portfolio fetching ✅
- Multi-account ✅
Things worth nothing here:
- Not a bug per se but not noticing affiliate anywhere in tonscan. Confirmed hitting https://api.ston.fi/v1/stats/fee_accruals?referrer_address=UQBGXUskbTDkLXJO_Q6cQFVbbkgvXKplcIhijiO5oDcB5qkI we are indeed getting affiliate fees, would be worth noting to @shapeshift/operations that this is where they can see fee accrual, not on Tonscan
- Gas is hardcoded to 0.005 TON - wondering if we want to make this dynamic?
- Failures are unhandled in action center and are parsed as confirmed in Tx history



There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.env:
- Around line 314-315: The UnorderedKey warning for the environment keys
VITE_FEATURE_STONFI_SWAP and VITE_FEATURE_TON is a false-positive per project
convention (alphabetical ordering is not required); either leave the keys as-is
or disable that rule in the dotenv-linter config by turning off UnorderedKey
(e.g., in your dotenv-linter config file) so the linter no longer flags
VITE_FEATURE_STONFI_SWAP and VITE_FEATURE_TON as an issue.
Description
Stacked on top of #11889
Enables TON blockchain support and Stonfi swapper across the application by activating feature flags in
.env.This PR builds on top of #11841 (referral fee implementation) and activates the TON chain and Stonfi swapper features.
Changes:
VITE_FEATURE_TONfrom.env.developmentVITE_FEATURE_STONFI_SWAPfrom.env.developmentVITE_FEATURE_TON=truein.envVITE_FEATURE_STONFI_SWAP=truein.envWhat This Enables:
Issue (if applicable)
Depends on #11841
Risk
Low Risk
Testing
Engineering
Prerequisites:
packages/utils/src/treasury.tsTest Cases:
TON Chain Visibility:
Stonfi Swapper:
Feature Flag Behavior:
.env.env.developmentuse config defaultsOperations
Testing Required:
Once merged, operations should test:
Rollback Plan:
If issues arise, disable features by setting:
Screenshots (if applicable)
N/A - Flag activation only
🤖 Generated with Claude Code
Summary by CodeRabbit