feat: add JWT refresh tests, sell transaction logging, and XLM delta formatter - #714
Merged
Chucks1093 merged 1 commit intoJul 29, 2026
Conversation
…formatter - Implement stateless JWT refresh (sign/verify + refresh-window logic) and add unit tests covering in-window refresh, out-of-window rejection, expired-token rejection, sub preservation, and stateless old-token validity. - Add structured info log emitted after a sell transaction is confirmed on-chain, wired into the indexer pipeline, with seller/creator wallet, key amount, XLM received, new supply, tx hash, and confirmation time. - Add formatXlmDelta bigint helper for signed XLM delta strings and apply it to the wallet activity (transaction history) serializer. Closes accesslayerorg#704 Closes accesslayerorg#705 Closes accesslayerorg#706
|
@zoffunjunior381-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
src/utils/jwt.utils.ts,src/modules/auth/token-refresh.utils.ts) with a 30-minute refresh window, and wired it into the/auth/refreshendpoint. Added unit tests covering: a token with 10 minutes remaining is refreshed, a token with 2 hours remaining returns 400refresh_not_due, an expired token returns 401token_expired, the new token'ssubmatches the original, and the old token remains valid after refresh (stateless).logSellTransactionConfirmed(src/utils/sell-transaction-logger.utils.ts), an info-level structured log emitted after a sell is confirmed on-chain, withseller_wallet,creator_wallet,key_amount,xlm_received(formatted XLM string),new_supply,tx_hash, andconfirmed_at. Wired into the indexer pipeline's sell branch so it fires after confirmation, not on submission. No key material or secrets are logged.formatXlmDelta(stroops, direction)(src/utils/xlm-delta.utils.ts), a bigint-only helper producing signed XLM delta strings (e.g.+1.0000000 XLM/-1.0000000 XLM). Applied it in the wallet activity (transaction history) serializer to compute anxlm_deltafield per trade.Test plan
pnpm exec tsc --noEmitpasses with no errorspnpm exec eslintpasses on all changed/new filesformatXlmDelta(8 tests),logSellTransactionConfirmed(4 tests),refreshAccessToken(7 tests)pnpm testrun shows no new regressions vs.main(pre-existing integration test failures that require a live Postgres database, e.g.creator-holders-404.test.ts,price-snapshot.integration.test.ts, are unrelated to this change and out of scope — they fail identically onmainwithout a DB connection)Closes #704
Closes #705
Closes #706
Closes #711