Description
This issue aims to address the implementation of Shared Soroban RPC Server Accessor on TrustFlowClient.
The core objective is to: Add a client.getSorobanServer() method to TrustFlowClient (mirroring its existing getServer() for Horizon) so that src/contract/invoke.ts, src/contract/read.ts, and src/contract/simulate.ts share one RPC server instance per client instead of each independently calling new SorobanRpc.Server(SOROBAN_RPC_URLS[client.network]). Today all three files construct their own throwaway RPC server client on every single call, with no caching or connection reuse, and any future cross-cutting change (timeouts, auth headers, retry wiring) would need to be applied in three separate places.
By completing this feature, we will ensure that the TrustFlow protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the SDK Wrapper architecture and adherence to the existing project conventions.
Component
SDK
Difficulty
🔴 Hard
Tasks
Acceptance Criteria
Estimated Time
2-3 days
Description
This issue aims to address the implementation of Shared Soroban RPC Server Accessor on TrustFlowClient.
The core objective is to: Add a
client.getSorobanServer()method toTrustFlowClient(mirroring its existinggetServer()for Horizon) so thatsrc/contract/invoke.ts,src/contract/read.ts, andsrc/contract/simulate.tsshare one RPC server instance per client instead of each independently callingnew SorobanRpc.Server(SOROBAN_RPC_URLS[client.network]). Today all three files construct their own throwaway RPC server client on every single call, with no caching or connection reuse, and any future cross-cutting change (timeouts, auth headers, retry wiring) would need to be applied in three separate places.By completing this feature, we will ensure that the TrustFlow protocol maintains its high standards for security, usability, and decentralized logic. This issue requires careful attention to the SDK Wrapper architecture and adherence to the existing project conventions.
Component
SDK
Difficulty
🔴 Hard
Tasks
TrustFlowClientinsrc/client.ts, which already exposesgetServer()forHorizon.Server)getSorobanServer()accessor onTrustFlowClientthat lazily constructs and caches aSorobanRpc.Server(once theSorobanRpcimport is fixed per a companion issue)src/contract/invoke.ts,read.tsandsimulate.tsto use the newclient.getSorobanServer()instead of constructing their own instancestypedoccomments for the new methodnpm run buildto verify standard bundlingAcceptance Criteria
client.getSorobanServer()method exists and is reused bycontract/invoke.ts,read.tsandsimulate.tscontract/invoke.ts,read.tsandsimulate.tsno longer each construct their ownSorobanRpc.ServerinstancesEstimated Time
2-3 days