Feature Improvements — Medium Priority
1. Centralize All API Calls Through request() Method
Files:
ts/src/client.ts lines 363-396 (getHistory), 412-448 (getAssetTree)
python/numbersprotocol_capture/client.py lines 454-466, 519-523
Description:
The TypeScript Capture class has a centralized request() method (lines 158-194) that handles authentication, error parsing, and response deserialization. However, getHistory, getAssetTree, searchAsset, and searchNft all call fetch() directly, bypassing this method. The same pattern exists in Python.
This means any future enhancements (retry logic from issue #7, logging, metrics, request tracing) will not automatically apply to these methods. Error handling is also duplicated and slightly inconsistent.
Expected impact:
All API calls benefit from centralized error handling, future retry logic, and observability hooks. This is a prerequisite for cleanly implementing issue #7.
Suggested implementation:
Refactor request() to accept a full URL (not just a path relative to baseUrl), or create a _rawRequest() that handles external URLs. Route all external API calls through it.
2. Feature Parity Script Does Not Fail CI on Violations
File: scripts/check-feature-parity.py lines 212-219
Description:
The feature parity script prints a report but the main() function always exits with code 0 (success). It never calls sys.exit(1) when parity violations are detected. This means the CI workflow step will always pass even if one SDK is missing features.
Expected impact:
Actually enforces feature parity between TypeScript and Python SDKs in CI.
Suggested implementation:
def main() -> None:
check_ts_features()
check_py_features()
all_parity = print_report()
if not all_parity:
sys.exit(1)
3. Add Request Cancellation and Custom HTTP Configuration for TypeScript
File: ts/src/client.ts lines 141-153, 176
Description:
The TypeScript SDK uses the global fetch function with no connection management. There is no way to:
- Use a custom HTTP agent (for proxies, custom TLS certificates, keep-alive tuning)
- Control connection pooling
- Cancel in-flight requests via
AbortController
The request() method at line 176 passes no signal option to fetch.
Expected impact:
Enables request cancellation, proxy support, and custom HTTP configuration for enterprise users.
Suggested implementation:
- Add optional
signal?: AbortSignal parameter to CaptureOptions or individual method options.
- Add optional
fetchImplementation option to CaptureOptions for custom fetch implementations.
- Pass
signal through to fetch() in the request() method.
4. CI Version Matrix Is Too Narrow
File: .github/workflows/ci.yml lines 69-99
Description:
- Python is only tested on 3.14 (pre-release).
pyproject.toml specifies requires-python = ">=3.14" which excludes Python 3.10-3.13 users entirely. This is likely an error.
- Node.js is only tested on version 20. The
engines field says >=18.0.0, but Node 18 and 22 are not tested.
- No test coverage thresholds are enforced in CI (
pytest-cov is configured but --cov-fail-under is not set).
Expected impact:
Broader compatibility assurance, catches regressions earlier, prevents coverage decay.
Suggested implementation:
- Lower
requires-python to >=3.11 or >=3.12 and add those versions to the CI matrix.
- Add Node.js 18 and 22 to a matrix strategy.
- Add
--cov-fail-under=80 to pytest configuration.
Feature Improvements — Medium Priority
1. Centralize All API Calls Through
request()MethodFiles:
ts/src/client.tslines 363-396 (getHistory), 412-448 (getAssetTree)python/numbersprotocol_capture/client.pylines 454-466, 519-523Description:
The TypeScript
Captureclass has a centralizedrequest()method (lines 158-194) that handles authentication, error parsing, and response deserialization. However,getHistory,getAssetTree,searchAsset, andsearchNftall callfetch()directly, bypassing this method. The same pattern exists in Python.This means any future enhancements (retry logic from issue #7, logging, metrics, request tracing) will not automatically apply to these methods. Error handling is also duplicated and slightly inconsistent.
Expected impact:
All API calls benefit from centralized error handling, future retry logic, and observability hooks. This is a prerequisite for cleanly implementing issue #7.
Suggested implementation:
Refactor
request()to accept a full URL (not just a path relative tobaseUrl), or create a_rawRequest()that handles external URLs. Route all external API calls through it.2. Feature Parity Script Does Not Fail CI on Violations
File:
scripts/check-feature-parity.pylines 212-219Description:
The feature parity script prints a report but the
main()function always exits with code 0 (success). It never callssys.exit(1)when parity violations are detected. This means the CI workflow step will always pass even if one SDK is missing features.Expected impact:
Actually enforces feature parity between TypeScript and Python SDKs in CI.
Suggested implementation:
3. Add Request Cancellation and Custom HTTP Configuration for TypeScript
File:
ts/src/client.tslines 141-153, 176Description:
The TypeScript SDK uses the global
fetchfunction with no connection management. There is no way to:AbortControllerThe
request()method at line 176 passes nosignaloption tofetch.Expected impact:
Enables request cancellation, proxy support, and custom HTTP configuration for enterprise users.
Suggested implementation:
signal?: AbortSignalparameter toCaptureOptionsor individual method options.fetchImplementationoption toCaptureOptionsfor custom fetch implementations.signalthrough tofetch()in therequest()method.4. CI Version Matrix Is Too Narrow
File:
.github/workflows/ci.ymllines 69-99Description:
pyproject.tomlspecifiesrequires-python = ">=3.14"which excludes Python 3.10-3.13 users entirely. This is likely an error.enginesfield says>=18.0.0, but Node 18 and 22 are not tested.pytest-covis configured but--cov-fail-underis not set).Expected impact:
Broader compatibility assurance, catches regressions earlier, prevents coverage decay.
Suggested implementation:
requires-pythonto>=3.11or>=3.12and add those versions to the CI matrix.--cov-fail-under=80to pytest configuration.