Skip to content

fix(soroban): add strict option to reject with ConfirmationTimeoutError on timeout (closes #596) - #679

Open
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-596-invoke-contract-confirmation-timeout
Open

fix(soroban): add strict option to reject with ConfirmationTimeoutError on timeout (closes #596)#679
Ranjeet2063 wants to merge 1 commit into
conduit-protocol:mainfrom
Ranjeet2063:feat/issue-596-invoke-contract-confirmation-timeout

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Summary

Adds an opt-in { strict: true } option to ConfirmationPollingOptions so callers can distinguish a confirmed transaction from an unconfirmed or timed-out submission via a typed ConfirmationTimeoutError (closes #596).

Changes

  • src/errors.ts:
    • Added ConfirmationTimeoutError carrying hash, attempts, and timeoutMs.
    • Registered ConfirmationTimeoutError in isConduitError().
  • src/soroban.ts:
    • Added strict?: boolean to ConfirmationPollingOptions and normalized defaults.
    • In invokeContract(), when strict: true and polling exceeds maxAttempts without SUCCESS/FAILED (or encounters network polling failure), throws ConfirmationTimeoutError.
    • Fully backward compatible: default non-strict mode continues to resolve unconfirmed hash as pending.
  • src/index.ts:
    • Re-exported ConfirmationTimeoutError.
  • src/tests/invoke-contract-confirmation-timeout.test.ts:
    • 6/6 unit tests covering timeout rejection, success resolution, failure rejection, network error handling, and type-guard recognition.

Verification

  • 6/6 unit tests passing.
  • Clean typecheck (tsc --noEmit).
  • Zero ESLint errors.
  • Successful production ESM/CJS build with Rollup.

Copilot AI lite review requested due to automatic review settings September 5, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invokeContract() silently resolves an unconfirmed hash after maxAttempts

2 participants