Complexity: High — 200 pts
Summary
Soroban is Stellar's smart contract platform. StellarFlow has no way to interact with deployed Soroban contracts. This issue adds a developer-focused "Contract" panel where users can enter a contract ID, simulate read-only calls, and invoke write functions using Freighter signing.
Files to Create/Modify
- Create:
src/lib/soroban.ts
- Create:
src/pages/ContractPage.tsx
- Modify:
src/App.tsx — add /contract route
Implementation Notes
soroban.ts
Use StellarSdk.SorobanRpc.Server('https://soroban-testnet.stellar.org').
export async function simulateContractCall(contractId, method, args: StellarSdk.xdr.ScVal[], sourceAddress)
export async function buildContractTx(contractId, method, args: StellarSdk.xdr.ScVal[], sourceAddress): Promise<string>
simulateContractCall builds a tx via contract.call(method, ...args) and calls rpc.simulateTransaction(tx). buildContractTx simulates first (throw on isSimulationError), then StellarSdk.SorobanRpc.assembleTransaction(tx, simResult).build().toXDR().
ContractPage layout
Contract ID: [input] [Load]
Methods:
• balance(address) [Simulate]
• transfer(to, amount) [Invoke]
Arguments: [JSON input]
Result: { "balance": "1000" }
- Arguments entered as JSON, converted via
StellarSdk.nativeToScVal
- Simulate shows result with no signing required
- Invoke builds tx → signs with Freighter → submits via RPC → shows result
Acceptance Criteria
Screen Recording Requirements (with a known Soroban testnet token contract)
- Enter contract ID → methods listed
- Simulate
balance(address) → result shown without signing
- Invoke
transfer(to, amount) → Freighter popup → execute → result shown
- Show the tx on Stellar Expert confirming the Soroban invocation
Complexity: High — 200 pts
Summary
Soroban is Stellar's smart contract platform. StellarFlow has no way to interact with deployed Soroban contracts. This issue adds a developer-focused "Contract" panel where users can enter a contract ID, simulate read-only calls, and invoke write functions using Freighter signing.
Files to Create/Modify
src/lib/soroban.tssrc/pages/ContractPage.tsxsrc/App.tsx— add/contractrouteImplementation Notes
soroban.tsUse
StellarSdk.SorobanRpc.Server('https://soroban-testnet.stellar.org').simulateContractCallbuilds a tx viacontract.call(method, ...args)and callsrpc.simulateTransaction(tx).buildContractTxsimulates first (throw onisSimulationError), thenStellarSdk.SorobanRpc.assembleTransaction(tx, simResult).build().toXDR().ContractPagelayoutStellarSdk.nativeToScValAcceptance Criteria
nativeToScValScreen Recording Requirements (with a known Soroban testnet token contract)
balance(address)→ result shown without signingtransfer(to, amount)→ Freighter popup → execute → result shown