Feature/stellar interceptor system#75
Open
tech-adrian wants to merge 9 commits intoNFTopia-Foundation:mainfrom
Open
Feature/stellar interceptor system#75tech-adrian wants to merge 9 commits intoNFTopia-Foundation:mainfrom
tech-adrian wants to merge 9 commits intoNFTopia-Foundation:mainfrom
Conversation
Author
|
@Oluwaseyi89 please review |
Author
|
@Oluwaseyi89 please review and merge |
Contributor
|
@Caxton22 resolve the linting errors. |
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.
This PR implements a comprehensive interceptor system for the NFTopia NestJS backend to handle Stellar-specific request and response transformations, Soroban contract error handling, transaction logging, and configurable timeouts.
Closes #67
Changes Proposed
src/config/stellar.config.tsto manage environment-specific variables like the RPC URL, network passphrase, and granular timeout configurations for simulations vs. submissions.src/common/errors/stellar.errors.ts(SorobanRpcError,TransactionFailedError,InsufficientBalanceError,InvalidSignatureError,ContractError).StellarResponseInterceptorto wrap outgoing DTOs in a consistent{ data, meta }format, automatically injecting the network context, timestamp, and optional transaction markers.StellarLoggingInterceptorutilizing Nest's logging utilities to trace RPC timings, Soroban contract calls, and general Stellar endpoint usage.StellarErrorInterceptorto catch our customStellarErrortypes, map them to standard HTTP exceptions (like502 Bad Gatewayor400 Bad Request), and automatically redact sensitive secret seeds (starting withS) from error traces.StellarTimeoutInterceptorrelying on RxJStimeoutoperators to cancel hanging Soroban streams and simulations based on configurable thresholds.StellarTransformInterceptorto unwrap Horizon pagination cursors correctly and normalize raw Stroops into XLMstringdecimal formats.src/nft/soroban.service.tsto throw the new custom exceptions and globally registered all interceptors and configs withinsrc/main.tsandsrc/app.module.ts.Acceptance Criteria Evaluated
stellar.config.ts.How to Test
feature/stellar-interceptor-system.SOROBAN_RPC_URLandSTELLAR_NETWORKenvironment variables set./api/v1/nftroutes.