feat(frontend): add Soroban contract invocation hook#181
Merged
Wilfred007 merged 1 commit intoGildado:mainfrom Feb 26, 2026
Merged
Conversation
c38461a to
bbfb8d2
Compare
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.
Description
Add a reusable Soroban contract invocation hook for frontend contract calls.
Closes #144
Changes proposed
What were you told to do?
I was tasked with creating a
useSorobanContract(contractId)React hook that abstracts direct Soroban smart-contract invocations for deployed contracts (bulk_payment, vesting_escrow, revenue_split).Requirements included:
invoke,loading,error, andresultstatesimulateTransactionbefore every live submissionuseWalletSigninguseNotificationtoast errorsWhat did I do?
Added a dedicated Soroban invocation hook
Updated
frontend/src/hooks/useSorobanContract.tswith:useSorobanContract(contractId)returninginvoke,loading,error, andresultparseResultcallbackIntegrated pre-flight simulation into invoke flow
Implemented invocation pipeline to:
Contract+TransactionBuildersimulateTransaction(...)Wired wallet signing through existing wallet hook
Integrated
useWalletSigningby:sign(...)Added on-chain result decoding and typed return
After submission and confirmation polling:
ScValviascValToNativeAdded robust error surfacing
Hook now:
notifyError(...)Check List (Check all the applicable boxes)
Screenshots / Testing Evidence
pnpm lintinfrontend/and no blocking lint errors were reported for this hook (only existing unrelated warning-level checks elsewhere)pnpm buildinfrontend/successfully