Skip to content

fix: resolve 7 TypeScript compilation errors blocking tsc --noEmit#50

Closed
Shantanu112-bd wants to merge 1 commit into
Stellar-Tools:mainfrom
Shantanu112-bd:fix/typescript-compilation-errors
Closed

fix: resolve 7 TypeScript compilation errors blocking tsc --noEmit#50
Shantanu112-bd wants to merge 1 commit into
Stellar-Tools:mainfrom
Shantanu112-bd:fix/typescript-compilation-errors

Conversation

@Shantanu112-bd
Copy link
Copy Markdown

@Shantanu112-bd Shantanu112-bd commented Apr 2, 2026

Summary

Fixes all 7 TypeScript compilation errors that caused
npx tsc --noEmit to fail, blocking IDE integration
and CI type-checking pipelines.

Changes

agent.ts

  • Fixed Server import → Horizon.Server (correct
    stellar-sdk v11+ pattern)
  • Added Network type union to fix TS2367
    non-overlapping string comparison errors
  • Added explicit types to balance variable inferences

examples/

  • Typed all catch blocks as error: unknown with
    instanceof Error guard — eliminates implicit any

lib/buildTransaction.ts

  • Fixed string equivalence type errors with proper
    type guards

Verification

npx tsc --noEmit → 0 errors
npm test        → 28 passed, 0 failed

Closes #49


Summary by cubic

Fixes seven TypeScript errors so npx tsc --noEmit passes and adds full network-aware Soroban/Horizon config across libs/tools. Bridge and contract/stake tools now support multi-chain/token flows with stricter schemas and better errors; all 28 tests pass.

  • New Features

    • Added ContractConfig/StakeConfig and networkPassphrase in buildTransaction; AgentClient injects Soroban config via getSorobanConfig for all contract ops.
    • Upgraded bridgeTokenTool to accept destinationChain and symbol with dynamic token lookup; wrapped in try/catch with clearer failures; mainnet guard preserved.
    • Refined tool schemas using Zod discriminated unions; staking tool takes fromNetwork and builds per-network RPC/passphrase; stellarSendPaymentTool respects STELLAR_NETWORK; signTransaction accepts an explicit secret key.
  • Bug Fixes

    • Switched to Horizon.Server from @stellar/stellar-sdk, typed balances with Horizon.ServerApi.BalanceLine, fixed TS2367 comparisons, and typed catch blocks as unknown; tests updated.
    • Removed hardcoded Testnet by propagating network inputs and using provided passphrases in fromXDR.

Written for commit 0db6861. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@gitguardian
Copy link
Copy Markdown

gitguardian Bot commented Apr 20, 2026

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
- - Generic Password 0db6861 tools/stellar.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@Shantanu112-bd Shantanu112-bd force-pushed the fix/typescript-compilation-errors branch from d448806 to 0db6861 Compare April 20, 2026 15:36
@daiwikmh
Copy link
Copy Markdown
Contributor

resolve merge conflicts

@daiwikmh daiwikmh closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: resolve 7 TypeScript compilation errors blocking tsc --noEmit

2 participants