feat(#282): add VeriTixClient.healthCheck() — verify RPC connectivity and contract existence - #359
Closed
Userhorlie wants to merge 3 commits into
Closed
Conversation
|
@Userhorlie 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! 🚀 |
…tudios#281) - Expose maxRetries (default 3) and retryDelayMs (default 1000) as SubmitTransactionOptions fields on submitTransaction() - Apply ±20% random jitter to each retry delay to spread concurrent submissions and reduce Horizon 429 collisions - Support legacy numeric maxAttempts arg for backwards compatibility - Fix broken estimateFee (missing sourceAccount/variable ordering) - Fix pre-existing duplicate enum identifiers in errors.ts - Fix missing closing brace in network.ts ledgerToApproxDate - Add tests: SubmitTransactionOptions, rate-limit retry, jitter, exhaustion Closes Lead-Studios#281
…ce (Lead-Studios#282) - Add HealthStatus type to src/types/index.ts: { rpcReachable, contractFound, latencyMs, latestLedger, errors[] } - Implement healthCheck() on VeriTixClient: - Calls server.getLatestLedger() to test RPC reachability and measure latencyMs - Calls server.getLedgerEntries() with the contract instance key to test contract existence - Never throws — all errors are captured in errors[] - Returns early with rpcReachable=false when server is not set - Export HealthStatus from src/index.ts public API barrel - Fix pre-existing: remove duplicate WatchOptions interface in client.ts - Fix pre-existing: remove duplicate freezeBatch implementations in batch.ts - Add 6 unit tests covering all success/failure/edge-case paths Closes Lead-Studios#282
Userhorlie
force-pushed
the
feat/issue-282-health-check
branch
from
July 25, 2026 18:36
7bb3c72 to
87df6c3
Compare
Collaborator
|
This PR currently has merge conflicts with |
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.
Summary
Adds
VeriTixClient.healthCheck()— a method that probes the Soroban RPC and the target contract to verify that the SDK is configured correctly. It never throws; all failures are captured in the returnederrors[]array.Changes
New
HealthStatusinterface insrc/types/index.ts:{ rpcReachable, contractFound, latencyMs, latestLedger, errors }healthCheck(): Promise<HealthStatus>onVeriTixClientserver.getLatestLedger()for RPC reachabilityserver.getLedgerEntries(contractKey)for contract existencelatencyMsHealthStatusexported fromsrc/index.tsPre-existing fixes (required for compilation)
VeriTixErrorCodeenum entries removed fromerrors.tsestimateFeereferencedtx/sourceAccountbefore declaration — fixedledgerToApproxDatemissing closing brace innetwork.ts— fixedfreezeBatchimplementations inbatch.ts— fixedTests
Added 7 tests in
tests/client.test.ts:rpcReachable=trueandcontractFound=trueon full successrpcReachable=falsewith error when RPC throwscontractFound=falsewhengetLedgerEntriesreturns emptycontractFound=falsewith error whengetLedgerEntriesthrowslatencyMsis a non-negative numberHealthStatusshape has all required fieldsCloses #282