Description
The src/lib/contracts/services.ts file currently wraps mock data from constants.ts. For production, it needs to call actual Soroban smart contracts deployed on Stellar.
Requirements
- Replace each
fetch* function with real rpc.Server calls using the contract IDs from src/lib/contracts/addresses.ts
- Use
buildAndSendContractCall from src/lib/contracts/client.ts for mutations
- Keep the mock data as a fallback when no wallet is connected or contracts are unreachable
- All functions must preserve their exact return types (
Asset[], Investor[], etc.)
Relevant files
src/lib/contracts/services.ts
src/lib/contracts/client.ts
src/lib/contracts/addresses.ts
Complexity: High (200 pts)
Requires understanding Soroban contract interaction, the existing client layer, and careful type mapping from ScVal to the app types.
Description
The
src/lib/contracts/services.tsfile currently wraps mock data fromconstants.ts. For production, it needs to call actual Soroban smart contracts deployed on Stellar.Requirements
fetch*function with realrpc.Servercalls using the contract IDs fromsrc/lib/contracts/addresses.tsbuildAndSendContractCallfromsrc/lib/contracts/client.tsfor mutationsAsset[],Investor[], etc.)Relevant files
src/lib/contracts/services.tssrc/lib/contracts/client.tssrc/lib/contracts/addresses.tsComplexity: High (200 pts)
Requires understanding Soroban contract interaction, the existing client layer, and careful type mapping from
ScValto the app types.