Repository navigation
Conversation
…ount tests - Stellar-split#1037: Comprehensive unit tests and edge cases for parseAmount (valid inputs, boundaries, negative numbers, truncation/rounding, invalid formats) - Stellar-split#1036: Add optional analytics tracking API with PrivacyController (secret scrubbing, address masking, PII protection), AnalyticsCollector, and reporting - Stellar-split#1035: Implement WebhookClient with HMAC-SHA256 verification, replay protection tolerance, middleware, event handlers, and HTTP adapter - Stellar-split#1034: Add WebSocket-based real-time invoice state subscription client with filtering and automatic exponential-backoff reconnection Closes Stellar-split#1034 Closes Stellar-split#1035 Closes Stellar-split#1036 Closes Stellar-split#1037
|
@dev-fani 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! 🚀 |
This branch has not been deployed
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.
What this fixes
parseAmount, including validation of multiple decimal points, fractional digit validation, negative amounts handling (-1.5, -0.5), boundary amounts (zero, sub-stroops, max i64, arbitrary bigints), and truncation behavior (dropping precision past 7 decimals without rounding up).What changed
parseAmount Enhancement & Comprehensive Unit Tests (Unit tests for parseAmount edge cases #1037):
-1.5->-15000000n,-0.5->-5000000n).test/parseAmount.test.tswith 24 test cases covering valid inputs, rounding/truncation, boundary conditions, and invalid syntax.parseAmountandformatAmountfrom SDK root.Analytics Tracking API & Privacy Controller (Add analytics tracking #1036):
src/analyticsTracking.tswithAnalyticsTracker,PrivacyController, andAnalyticsCollector.enabled: falseby default) with explicitoptIn()/optOut()and Do Not Track detection.S...), anonymization/masking of public keys (G...), removal of PII fields (email,ip,password), and strict privacy mode.wrapClientWithAnalyticsto intercept method latency and success/error status.test/analyticsTracking.test.tswith 14 unit tests.Webhook Client Library (Implement webhook client #1035):
src/webhookClient.tsand re-exported fromsrc/webhooks/index.tsandsrc/index.ts.crypto.timingSafeEqualagainst raw request body and timestamp to prevent replay attacks.on("payment", ...)), wildcard handlers (on("*", ...)),once(),off(), andonError().use()).createHttpHandler()adapter for Node.jshttp/expressservers.test/webhookClient.test.tswith 17 unit tests.Real-time Invoice State Subscription (Add real-time invoice state subscription #1034):
src/invoiceStateSubscription.tswithInvoiceStateSubscriberandmatchesFilter.invoiceId, wildcard"*", lifecyclestatus,creator,payer,minFunded, and custom predicate functions, with dynamic runtime updates viaupdateFilter().maxAttempts, heartbeat ping/pong, and automatic re-subscription on reconnect.test/invoiceStateSubscription.test.tswith 12 unit tests.Testing
All tests executed locally via Vitest:
test/parseAmount.test.ts: 24 passedtest/analyticsTracking.test.ts: 14 passedtest/webhookClient.test.ts: 17 passedtest/invoiceStateSubscription.test.ts: 12 passedtest/sdkExports.test.ts: 4 passedtest/property-roundtrip.test.ts: 8 passedtest/property-client-invariants.test.ts: 10 passednpm test(test/client.test.ts,test/retryPolicy.test.ts,test/network-environment.test.ts): 110 passedTotal: 199 tests passed across all suites.
Issues
closes #1034
closes #1035
closes #1036
closes #1037