Skip to content

[Build Tx/Smart Contract] Auto-fetch contract methods on valid contract id#2129

Open
jeesunikim wants to merge 1 commit into
mainfrom
issue-2028
Open

[Build Tx/Smart Contract] Auto-fetch contract methods on valid contract id#2129
jeesunikim wants to merge 1 commit into
mainfrom
issue-2028

Conversation

@jeesunikim

Copy link
Copy Markdown
Contributor

Debounced effect fetches contract data as soon as a valid contract id is filled in, instead of requiring a button click. Replaces the mount-only auto-fetch and is gated on contract id validation.

Debounced effect fetches contract data as soon as a valid contract id is
filled in, instead of requiring a button click. Replaces the mount-only
auto-fetch and is gated on contract id validation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 26, 2026 23:08
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Jun 26, 2026
@jeesunikim jeesunikim changed the title [Smart Contract Page] Auto-fetch contract methods on valid contract id [Build Tx/Smart Contract] Auto-fetch contract methods on valid contract id Jun 26, 2026
@jeesunikim jeesunikim requested a review from quietbits June 26, 2026 23:09
@jeesunikim jeesunikim linked an issue Jun 26, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Soroban invoke-contract form control to automatically fetch contract metadata/methods once a valid contract ID is entered, replacing the previous mount-only auto-fetch behavior and reducing reliance on an explicit “Fetch contract methods” button click.

Changes:

  • Replace mount-only auto-fetch with a debounced useEffect that triggers after the user finishes entering a valid contract ID.
  • Gate auto-fetch on contract ID validation to avoid fetching on incomplete/invalid IDs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 149 to +153
useEffect(() => {
if (contractIdInput && value?.function_name && !contractMethods.length) {
fetchContractData();
if (!contractIdInput || validate.getContractIdError(contractIdInput)) {
return;
}
// Run only on mount

@stellar-jenkins-ci

Copy link
Copy Markdown

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

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

"Fetch contract" button to autoload on build transaction

3 participants