Skip to content

[Backend] sorobanService: drop second TransactionBuilder/Account/Networks import inside simulateContractCall #639

@ogazboiz

Description

@ogazboiz

Join the discussion on Telegram

Why this matters

backend/src/services/sorobanService.ts line 52 does a dynamic await import('@stellar/stellar-sdk') to destructure TransactionBuilder, Account, Networks:

const { TransactionBuilder, Account, Networks } = await import('@stellar/stellar-sdk');

But all three names are already statically imported at the top of the file (line 1):

import { rpc, xdr, StrKey, Contract, nativeToScVal, Keypair, TransactionBuilder, Account, Networks } from '@stellar/stellar-sdk';

The dynamic import is dead and shadows the static names. Every call to simulateContractCall pays the cost of a redundant import resolution.

Acceptance criteria

  • Delete line 52
  • Confirm the function still type-checks (it uses the top-level imports already)
  • No behavior change

Files to touch

  • backend/src/services/sorobanService.ts (line 52)

Out of scope

  • Refactoring pauseStream/resumeStream/withdraw which also dynamic-import Address (separate issue would be to do the same cleanup there if Address were already statically imported — it currently isn't)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksgood first issueGood for newcomersrefactorRefactoring existing code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions