Repository navigation
Conversation
…rformance and error code guides - Refactor monolithic StellarSplitClient into logical sub-modules (InvoiceModule, PaymentModule, DisputeModule, AdminModule, GroupModule, TemplateModule, MilestoneModule) while preserving full backward-compatible API (Stellar-split#1079) - Improve TypeScript type definitions with advanced generics, Result<T, E> discriminated union, PaginatedResponse<T>, branded types, status-narrowed invoices, and utility types (Stellar-split#1080) - Add comprehensive performance tuning guide with optimization techniques, tradeoffs, code examples, and empirical benchmark measurements (Stellar-split#1078) - Add complete error code reference guide with causes, recovery actions, and code examples for the full error taxonomy (Stellar-split#1077) - Add full test coverage for modules, type definitions, and error taxonomy
|
@iam-mercy 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
StellarSplitClientwas a monolithic class containing thousands of lines across disparate domains (invoices, payments, disputes, admin actions, grouping, templates, and milestones), making maintenance, domain isolation, and modular consumption difficult.What changed
Client Modularization (Refactor client into modules #1079):
src/client/modules/:InvoiceModule: Creation, cloning, updates, queries, cancellations, sync, snapshots, and verification.PaymentModule: Payments, simulations, batch payments, receipt generation, refunds, and reconciliations.DisputeModule: Dispute raising, arbiter voting, resolution, and evidence attachment.AdminModule: Administrative freeze/unfreeze and timelocked actions.GroupModule: Group creation, invoice attachment, release, and aggregation statistics.TemplateModule: Template storage, template creation, and recurring invoice management.MilestoneModule: Milestone completions, active milestone tracking, and funding round closure.invoices,payments,disputes,admin,groups,templates,milestones) toStellarSplitClient.StellarSplitClient.src/client/index.tsandsrc/index.ts.Type Definitions & Utilities (Add type definitions improvements #1080):
Invoice<TMetadata, TStatus>andCreateInvoiceParams<TMetadata>generic with backward-compatible defaults.Result<T, E>discriminated union withok(),err(),isOk(),isErr(),unwrapResult(),mapResult(),mapErr(), andmatchResult().PaginatedResponse<T>generic interface and constructor helper.StroopAmount,StellarAddress,InvoiceIdwith safe conversion helpers (toStroops,toStellarAddress,toInvoiceId).PendingInvoice,ReleasedInvoice, etc.) and type guard functions (isPendingInvoice,isReleasedInvoice,isInvoiceStatus).DeepPartial,DeepReadonly,RequireKeys,OptionalKeys,StrictOmit,RequireAtLeastOne,RequireOnlyOne.Performance Tuning Guide (Create performance tuning guide #1078):
docs/PERFORMANCE_TUNING.mddocumenting:rpcPoolSize) with 85% latency reduction benchmarks.setBatchingEnabled) with 93% network roundtrip reduction.cache) with sub-millisecond reads.rpcEndpoints).bumpStorageTtlBatch) saving 62% in fees.Error Code Reference Guide (Add error code reference guide #1077):
docs/ERROR_CODES.mdcataloging the complete SDK error taxonomy across invoice lifecycle, payments, network/RPC, access control, disputes, milestones, and batch operations.src/errors.ts:RoundNotEndedError,WrongMilestoneError,NothingToClaimError,InvoiceExpiredError,PayerNotWhitelistedError,ContributionCapExceededError,PaymentCooldownActiveError,ContractFrozenError,InvoiceFullyFundedError, andDelegateLimitReachedError.isRetryable()to distinguish transient retryable conditions (RPC 429/503, timeouts, cooldowns) from terminal contract errors.Testing
test/client.test.ts(68 passed)test/retryPolicy.test.ts(31 passed)test/network-environment.test.ts(11 passed)test/clientModules.test.ts(12 passed)test/typeImprovements.test.ts(16 passed)test/errorCodes.test.ts(10 passed)test/sdkExports.test.ts(3 passed)Issues
closes #1080
closes #1079
closes #1078
closes #1077