Skip to content

blockchain training#87

Open
Jumongweb wants to merge 1 commit into
StellarTips:mainfrom
Jumongweb:main
Open

blockchain training#87
Jumongweb wants to merge 1 commit into
StellarTips:mainfrom
Jumongweb:main

Conversation

@Jumongweb

@Jumongweb Jumongweb commented Jun 19, 2026

Copy link
Copy Markdown

closes #70
Implemented the Soroban contract webhook flow end to end.
The new route is POST /stellar/contract/webhook in src/stellar/stellar.controller.ts (line 78), with raw-body HMAC verification enabled from bootstrap in src/main.ts (line 14). The webhook logic lives in src/stellar/stellar.service.ts (line 172): it verifies x-stellar-signature against STELLAR_WEBHOOK_SECRET, rejects events outside the 5-minute replay window, treats existing transaction hashes as idempotent 200 replays, persists TIP_EVENTs, fires creator notifications, and updates linked withdrawal state for WITHDRAWAL_EVENTs. I also documented the contract topics in src/stellar/contract/events.ts (line 1).
To support linked withdrawals and cleaner idempotency, I extended the tip model in src/entities/tip.entity.ts (line 17) with withdrawalStatus and withdrawalTransactionHash, and I tightened tip creation in src/tips/tips.service.ts (line 214) so pending tips store null instead of '' for transactionHash. I added coverage for valid signed events, invalid signatures, replayed events, stale events, and linked withdrawals in test/stellar-contract-webhook.e2e-spec.ts (line 30).
I wasn’t able to complete a real test run locally because this workspace didn’t have a usable dependency install, and npm ci failed with an npm CLI error (Exit handler never called!) while populating node_modules.

@Jumongweb Jumongweb closed this Jun 19, 2026
@Jumongweb Jumongweb reopened this Jun 19, 2026

Copy link
Copy Markdown
Contributor

Hey! Looks like CI is red across the board here — e2e tests, lint, typecheck, and unit tests all failing. Could you take a look and get the build green? Happy to help unblock if you want to pair on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add webhook endpoint for on-chain tip events from Soroban contract

2 participants