-
Notifications
You must be signed in to change notification settings - Fork 1
fix: NEP-245 multi-token support using token registry instead of RPC #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: petersalomonsen <9760441+petersalomonsen@users.noreply.github.com>
- nep245 avalanche token is USDC with 6 decimals, not ETH with 18 - nep141:wrap.near symbol is NEAR, not wNEAR - Apply cargo fmt formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
petersalomonsen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@race-of-sloths score 3
|
@akorchyn I have tested these changes manually, and it seems to work as intended |
|
@Copilot Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 3! @petersalomonsen received 25 Sloth Points for reviewing and scoring this pull request. What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
Summary
Fixes #25
NEP-245 multi-token IDs like
intents.near:nep245:v2_1.omni.hot.tg:43114_111...contain multiple colons, causing AccountId parsing to fail when attempting RPC calls. The old code would strip the prefix and try to parsev2_1.omni.hot.tg:43114_...as an account ID.Changes
intents_tokens.rs): AddedDEFUSE_TOKENS_MAP_CELLHashMap andfind_token_by_defuse_asset_id()for O(1) lookups by defuseAssetIdcounterparty.rs): Modifiedensure_ft_metadata()to detect allintents.near:*tokens and use registry instead of RPC callsTest Plan
cargo test --test nep245_token_registry_testExample
All intents tokens (NEP-141 and NEP-245) now use the token registry from
data/tokens.json. Regular FT tokens continue using RPC queries unchanged.