Repository navigation
feat(agent): answer USDT0 questions with the verified issuer - #935
Merged
Miracle656 merged 1 commit intoSep 30, 2026
Merged
Conversation
|
@royalTreasure Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@royalTreasure is attempting to deploy a commit to the miracle656's projects Team on Vercel. A member of the Team first needs to authorize it. |
6 tasks done
4 of 16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #795
Summary
The agent now resolves USDT0 (and USDC) by issuer, names the issuer when it answers, and reports a same-code asset from a different issuer as unverified. A code match alone never verifies anything.
Changes (
packages/agent)src/assets.ts: a small registry pinned by issuer per network (mainnet USDT0GATISXX6…HN6Qwith its SAC and issuer-controls; USDC per network),classifyHolding/classifyBalances(verified= code and issuer match,unverified= registered code but a different issuer,unlisted= code not in the registry, nothing claimed), anddescribeAsset.get_wallet_balancekeeps its flat balances and addsholdings: each issued asset with its issuer, status and a plain-language message. A fake USDT0 is reported asUNVERIFIEDwith its issuer and the registered issuer; a real one is reported with its issuer.get_asset_infotool answers "what is USDT0": verified issuer, SAC, and that the issuer can freeze a trustline and claw back a balance; givenCODE:ISSUERit says whether that issuer is the registered one.frontend/docs/pages/agent-integration.mdxtool tables updated.Verification
In
packages/agent(plainnpm install):npm test-> Test Suites: 8 passed; Tests: 71 passed (12 new acrossassets.test.tsandagentAssets.test.ts, 59 existing). The "import after the Jest environment has been torn down" noise comes fromserver.test.tsand appears with or without this change.npx tsc --noEmit-> clean.agentAssets.test.tsrun against the originalagent.ts-> 6 failed, 6 total.runAgentwith a scripted provider and a mockedgetBalances), not the model's closing text. The pinned SAC is derived from the issuer (Asset.contractId(Networks.PUBLIC)) and compared, and every hard-coded G/C address is checked withStrKey.isValidEd25519PublicKey/isValidContract.Caveats
unlisted, never "verified". Adding an asset means adding its issuer, not its code.get_price/build_paymentinputs are unchanged (they already takeCODE:ISSUER).getBalancesis mocked in the new tests.