Description
src/types/contract.ts defines ContractCallResult (success, returnValue?, txHash?, errorCode?, gasUsed?) as the apparent intended shape for a contract invocation's outcome. But invokeContract (src/contract/invoke.ts) is typed to return Promise<unknown> and actually resolves { operation, account, server } — the raw, internal Contract.call(...) operation object, the Account returned by server.getAccount(caller), and the SorobanRpc.Server instance itself — none of which is a ContractCallResult. ContractCallResult currently has zero producers anywhere in src/ (grepping for it shows only its own declaration and its re-export via contract/index.ts), meaning the type that looks like the contract module's primary output type is entirely unused in practice, while the function that should produce it leaks unrelated internal SDK objects to its caller instead.
Component
SDK
Difficulty
🟡 Medium
Tasks
Acceptance Criteria
Estimated Time
1-2 days
Description
src/types/contract.tsdefinesContractCallResult(success,returnValue?,txHash?,errorCode?,gasUsed?) as the apparent intended shape for a contract invocation's outcome. ButinvokeContract(src/contract/invoke.ts) is typed to returnPromise<unknown>and actually resolves{ operation, account, server }— the raw, internalContract.call(...)operation object, theAccountreturned byserver.getAccount(caller), and theSorobanRpc.Serverinstance itself — none of which is aContractCallResult.ContractCallResultcurrently has zero producers anywhere insrc/(grepping for it shows only its own declaration and its re-export viacontract/index.ts), meaning the type that looks like the contract module's primary output type is entirely unused in practice, while the function that should produce it leaks unrelated internal SDK objects to its caller instead.Component
SDK
Difficulty
🟡 Medium
Tasks
invokeContract's return type toPromise<ContractCallResult>invokeContract(or clearly split it intoprepareInvocation/submitInvocationsteps) so it can actually populatesuccess,txHash,returnValue,errorCode,gasUsedinstead of returning intermediate SDK objectsAcceptance Criteria
invokeContractreturns aContractCallResult, not raw internal SDK objectsContractCallResulthas at least one real producer in the codebaseEstimated Time
1-2 days