feat: Call lifecycle overhaul#60
Open
Alanwiz00 wants to merge 6 commits into
Open
Conversation
- Derive isReadOnly from the SorobanDataBuilder footprint returned by simulateCall; emit null from the parser instead of hardcoding false - Eagerly probe all primitive-param functions on contract load using dummy args; Struct/Enum/Map params are skipped and stay unknown - Hide Submit for confirmed read-only functions, show read only badge in the list, and sort write → unknown → read-only
- Capture minResourceFee from simulation response; total fee shown is minResourceFee + BASE_FEE, matching what prepareTransaction signs - Display fee in TxResult for mutating functions only; clears on function change, input edit, Clear, or new simulation - Fix stale result panel when switching functions
- `invokeCall` fires `submitted → pending → confirmed/failed` callbacks during polling; `TxResult` renders live status with a spinner or status dot - All error surfaces now return plain English: HostError diagnostic dumps (`Contract error: Check your inputs`), XDR result codes, and pre-submission rejections are each parsed before reaching the UI - 14 new tests covering status sequences, 30-poll timeout, send/on-chain failures, and simulate error parsing (42 total)
…n-Contract-Explorer into call-lifecycle-overhaul
|
@Alanwiz00 is attempting to deploy a commit to the raymondabiola's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #59
Summary
This PR improves the contract invocation flow by addressing three related areas: read-only function detection, resource fee estimation, and transaction submission feedback.
Read-only function detection
Resource fee estimation
Submission lifecycle and error handling
Replaces the single loading state with explicit transaction status updates throughout the submission lifecycle:
Preserves the existing polling timeout (30 attempts / ~30 seconds).
Replaces raw XDR and
HostErrorpayloads with human-readable error messages wherever possible, while falling back to a concise generic message when a specific cause cannot be determined.Test Plan
balanceorget) and verify functions are classified immediately.npm testand verify all existing tests pass.npm run buildand verify the project compiles without TypeScript errors.