feat(backend): wire top-up stream endpoint to Soroban contract (#415)#439
feat(backend): wire top-up stream endpoint to Soroban contract (#415)#439cybermax4200 wants to merge 7 commits intoLabsCrypt:mainfrom
Conversation
|
hey, main was failing CI from broken auth imports + frontend parse errors. fixed and pushed to main now. please rebase to pick up the fixes: git fetch upstream
git rebase upstream/main
git push --force-with-leaseif there's a conflict, resolve it locally and we'll review once CI is green. |
6294720 to
8ef3f47
Compare
The CI is now green |
|
hey, since main now has #444 merged (the cancel stream endpoint), your branch is showing stale modifications to please rebase again to drop those: git fetch upstream
git rebase upstream/main
# during rebase, when conflicts appear in cancel.ts or sorobanService.ts:
git checkout upstream/main -- backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git add backend/src/controllers/stream/cancel.ts backend/src/services/sorobanService.ts
git rebase --continue
git push --force-with-leaseafter that, your diff should only show the actual feature for this PR and we can merge. |
476fab3 to
dc4d2fb
Compare
4a03137 to
4e20dd3
Compare
I have dropped our copy of cancel.ts and sorobanService cancel logic in favour of main's version. The branch now only adds the top-up endpoint. CI is now green, please merge |
Closes #415
Changes
backend/src/services/sorobanService.ts
topUpStream(streamId, amount, callerAddress)— builds, simulates,signs with KEEPER_SECRET_KEY, submits
top_up_streamcontract call,returns txHash
backend/src/controllers/stream.controller.ts
topUpStreamHandleramountas positive integer string (XLM stroops) → 400 on failuretopUpStream(); updatesdepositedAmount+lastUpdateTimein DB on successbackend/src/routes/v1/stream.routes.ts
POST /:streamId/top-upbehindauthMiddlewarebackend/tests/integration/top-up.test.ts
404 stream not found, 403 wrong caller, DB update assertion
Env var required
KEEPER_SECRET_KEY— Stellar secret key used to sign the contract transaction