feat: add Stellar asset trustline manager and balance widget - #97
Conversation
|
@Timmmytunner is attempting to deploy a commit to the Cjay's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Timmmytunner 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! 🚀 |
|
Needs review Linked to The pull request introduces multiple syntax and compilation errors that break the build. Reviewed commit: |
|
Needs changes Code contains unresolved placeholder template syntax in supported asset definitions.
Reviewed commit: |
|
MergeKeeper review unavailable AI provider review response did not contain valid JSON No approval or merge action was taken. |
There was a problem hiding this comment.
Needs changes
The pull request introduces multiple syntax errors and TypeScript compilation issues across newly added and modified files.
src/features/transactions/useXdrSigner.ts:52: Syntax error: unexpected token 'corst' instead of 'const'.src/features/transactions/useXdrSigner.ts:100: Syntax error: invalid syntax in signTransaction call and trailing '??;' operator.src/features/wallet/useTrustlineManager.ts:4: Syntax error: incorrect import statement 'import { g} from 'zod';'.src/features/wallet/useTrustlineManager.ts:37: Syntax error: unexpected tokens '> >' in Promise return type declaration.src/features/wallet/useTrustlineManager.ts:47: Syntax error: invalid escaped newline literals '\n' inside object mapping properties.src/services/stellar.ts:13: Syntax error: missing closing parenthesis in 'import { z from 'zod';'.src/services/stellar.ts:52: Typo in variable reference: 'STELDAR_NETWORKS' should be 'STELLAR_NETWORKS'.src/services/stellar.ts:178: Syntax error: unterminated string literal and malformed error cause object in throw statement.
Reviewed commit: c5986feb3e8ebcce6921f6429dedfd8a8d0cf404.
There was a problem hiding this comment.
Needs changes
The PR introduces syntax and import errors in several TypeScript files, notably missing/invalid imports, typos in configuration constants, and broken Zod schema exports.
src/features/transactions/useXdrSigner.ts:2: Syntax error: 'import * freighter from '@stellar/freighter-api';' is missing the 'as' keyword.src/features/transactions/useXdrSigner.ts:7: Typo in environment variable name 'NEXT_PUBLIC_STELLAR_NETWORK_PASSHARE' (missing 's').src/features/wallet/trustline-schema.ts:1: File is minified onto a single line and missing a trailing newline.src/features/wallet/useTrustlineManager.ts:1: Import error: 'effect' is imported from 'react' instead of 'useEffect'.src/features/wallet/useTrustlineManager.ts:6: Import error: path '/stores/wallet' uses an absolute-style import missing the standard project alias or relative path.src/features/wallet/useTrustlineManager.ts:9: URL typo in HORIZON_URL ('horyzon.stellar.org').src/features/wallet/useTrustlineManager.ts:90: Undefined variable reference 'NETWORK_PASSHPRASE' (typo in constant name).src/services/stellar.ts:52: Undefined variable reference 'STELDAR_NETWORKS' (typo).src/services/stellar.ts:176: Syntax error: unclosed string literal and malformed error cause object in catch block.
Reviewed commit: 837b8a5fc446496358fbed67d6fee631f7af70fc.
There was a problem hiding this comment.
Needs changes
TypeScript compilation fails due to a typo in the exported interface name within useXdrSigner.ts.
src/features/transactions/useXdrSigner.ts:11: Typo in interface name 'UseXdrnSignerResult' prevents correct type checking and imports.
Reviewed commit: 20e622c991e4cce57ec2e4d0bf95d4d3c4a72fee.
|
MergeKeeper review Scope: in scope for linked issue The PR successfully implements the Stellar trustline manager and balance widget with Zod validation, Freighter integration, and robust error handling. Reviewed commit: |
There was a problem hiding this comment.
Needs changes
Trustline manager implementation contains broken imports and type mismatches that break compilation.
src/features/wallet/useTrustlineManager.ts:4: Import from 'zod' uses 'Z' instead of 'z'. Should beimport { z } from 'zod';.src/features/wallet/useTrustlineManager.ts:5: Import path '/stores/wallet' is incorrect or absolute without mapping; should import from relative path or correct store alias (e.g., '@/stores/freighter-store').src/features/transactions/useXdrSigner.ts:2: Import of freighter is missing star/as syntax:import * freighter from '@stellar/freighter-api';should beimport * as freighter from '@stellar/freighter-api';.src/features/transactions/useXdrSigner.ts:7: Typo in environment variable name:NEXT_PUBLIC_STELLAR_NETWORK_PASSHAREshould likely beNEXT_PUBLIC_STELLAR_NETWORK_PASSPHRASE.src/features/transactions/useXdrSigner.ts:10: Interface name typo:UseXdrnSignerResulthas an extra 'n', whereas the hook returnsUseXdrSignerResult.
Reviewed commit: 91c80515ac09fb2fe08a6729c7e7148098754e6f.
There was a problem hiding this comment.
Needs changes
The PR contains a typo in an environment variable name ('STELL@R_HORIZON_URL') and a type/interface name mismatch in 'useXdrSigner.ts'.
src/features/transactions/useXdrSigner.ts:176: Typo in variable name: 'STELL@R_HORIZON_URL' contains an '@' symbol instead of an 'a'.src/features/transactions/useXdrSigner.ts:20: Interface name mismatch: exported interface is named 'UseXdrnSignerResult' with an extra 'n', but return type ofuseXdrSigner()expectsUseXdrnSignerResultwhile standard convention isUseXdrSignerResult.
Reviewed commit: 804cf61635a7e2a851a62e6387258e16742ccd55.
There was a problem hiding this comment.
Needs changes
There is a typo in an exported interface name (UseXdrnSignerResult) and a typo in a horizon URL variable assignment in useXdrSigner.ts.
src/features/transactions/useXdrSigner.ts:20: Exported interface name has a typo: UseXdrnSignerResult instead of UseXdrSignerResultsrc/features/transactions/useXdrSigner.ts:171: Typo in variable reference: STELL@R_HORIZON_URL should be STELLAR_HORIZON_URL
Reviewed commit: 30aded07106b126c33eca93f0db07afee62bd564.
There was a problem hiding this comment.
Needs changes
Typo in import path and invalid syntax in stellar.ts block scope
src/features/wallet/useTrustlineManager.ts:5: Invalid import path '/stores/wallet' (should likely be relative or absolute alias matching tsconfig)src/services/stellar.ts:171: Syntax error: unexpected token or malformed property access in getSupportedAssetStatuses (getSupportedAssetsForNetwork.networkConfig.passphrase)
Reviewed commit: 047faa4bc82842313c4748b1ece83512f45cdad9.
There was a problem hiding this comment.
Needs changes
Fix compile errors including a typo in STELL@R_HORIZON_URL and mismatched Zod package imports.
src/features/transactions/useXdrSigner.ts:187: Typo in variable name STELL@R_HORIZON_URL which will cause a reference error.src/features/wallet/useTrustlineManager.ts:4: Incorrect import: 'import { Z } from 'zod';' should be 'import { z } from 'zod';'.
Reviewed commit: ddb7b320c06d0aa8c7cef58f160aa55759607159.
There was a problem hiding this comment.
Needs changes
Typo in Stellar Horizon URL variable name causes build/runtime failure in src/features/transactions/useXdrSigner.ts.
src/features/transactions/useXdrSigner.ts:176: Typo in variable name STELL@R_HORIZON_URL will cause a ReferenceError at runtime.
Reviewed commit: 0ef2df2258ee6753d9ba8650c00d15166ab9fbff.
There was a problem hiding this comment.
Needs changes
Code contains unresolved placeholder template syntax in supported asset definitions.
src/services/stellar.ts:151: Template literals use invalid syntaxg@${'A'.repeat(55)}instead of valid Stellar public keys likeG${'A'.repeat(55)}.
Reviewed commit: fb89feb9424a92704ce89fa3a646a1c657c6dd40.
Overview
This PR adds a Stellar Trustline Manager and Balance Widget that lets organizations review established trustlines for connected Stellar wallets, inspect asset balances, and start trustline creation transactions for supported stablecoins and tokens — with strict Zod validation and resilient wallet-state handling.
Related Issue
Closes #
Changes
🪙 Trustline Manager & Balance Widget
[ADD]
src/features/wallet/trustline-schema.ts[ADD]
src/features/wallet/useTrustlineManager.tsTrustlineManagerwidget: loads trustlines, maps balances, and exposes anaddTrustlineaction.sonnertoasts.[MODIFY]
src/hooks/useStellarWallet.tsandsrc/stores/freighter-store.tsrefreshBalances()method after trustline mutations.[ADD]
src/features/transactions/useXdrSigner.tssignTransactionwith Stellar network passphrase handling and error normalization.[MODIFY]
src/services/stellar.tschangeTrustXDR construction, trustline balance lookup, and asset info helpers for supported stablecoins/tokens.[MODIFY]
src/types/domain.tsTrustlineAsset,AssetBalance,TrustlineStatus, andTrustlineManagerStatedomain types used by the widget and hook.Verification Results
changeTrustXDR is built via Stellar SDK and signed with Freightersonneron failure.Closes #72