You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Stellar smart contracts (contracts/assetsup/) are written and tested but the backend has no code to interact with them. This issue creates the StellarModule — the NestJS wrapper around the Stellar SDK that all blockchain feature modules will use.
Context
package.json has @stellar/[email protected] installed but never imported
The deployed contract address will come from STELLAR_CONTRACT_ID env var
The backend needs a funded Stellar keypair to sign and submit transactions: STELLAR_SECRET_KEY env var
The contracts source is at contracts/assetsup/src/lib.rs — review exported functions before implementing
Acceptance Criteria
Add env vars to backend/.env.example: STELLAR_NETWORK (testnet|mainnet), STELLAR_RPC_URL, STELLAR_SECRET_KEY, STELLAR_CONTRACT_ID, STELLAR_NETWORK_PASSPHRASE
Create StellarModule and StellarService using @stellar/stellar-sdk
StellarService.buildKeypair() — loads keypair from STELLAR_SECRET_KEY
StellarService.simulateTransaction(contractId, method, args) — uses Soroban RPC simulateTransaction, returns decoded result without submitting
StellarService.submitTransaction(contractId, method, args) — builds the Soroban transaction, signs with keypair, submits, polls for confirmation, returns { txHash, ledger, result }
StellarService.getContractData(contractId, key) — reads on-chain storage for a given data key
All Stellar errors are caught and wrapped in NestJS ServiceUnavailableException with a descriptive message
Overview
The Stellar smart contracts (
contracts/assetsup/) are written and tested but the backend has no code to interact with them. This issue creates theStellarModule— the NestJS wrapper around the Stellar SDK that all blockchain feature modules will use.Context
package.jsonhas@stellar/[email protected]installed but never importedSTELLAR_CONTRACT_IDenv varSTELLAR_SECRET_KEYenv varcontracts/assetsup/src/lib.rs— review exported functions before implementingAcceptance Criteria
backend/.env.example:STELLAR_NETWORK(testnet|mainnet),STELLAR_RPC_URL,STELLAR_SECRET_KEY,STELLAR_CONTRACT_ID,STELLAR_NETWORK_PASSPHRASEStellarModuleandStellarServiceusing@stellar/stellar-sdkStellarService.buildKeypair()— loads keypair fromSTELLAR_SECRET_KEYStellarService.simulateTransaction(contractId, method, args)— uses Soroban RPCsimulateTransaction, returns decoded result without submittingStellarService.submitTransaction(contractId, method, args)— builds the Soroban transaction, signs with keypair, submits, polls for confirmation, returns{ txHash, ledger, result }StellarService.getContractData(contractId, key)— reads on-chain storage for a given data keyServiceUnavailableExceptionwith a descriptive message