Repository navigation
Description
Page: https://developers.stellar.org/docs/build/guides/dapps/frontend-guide#interacting-with-smart-contracts
File: docs/build/guides/dapps/frontend-guide.mdx:620-650
What's wrong:
The counter example sends and polls by hand, and part of it breaks on SDK v17 (current release v17.4.0):
- It reads the return value with
resultMetaXdr.v4().sorobanMeta()?.returnValue(). In v17,v4is a property, not a method (v17.4.0transaction-meta.ts#L227-L228), so.v4()throws. - It polls
getTransactionin awhileloop with no limit. The SDK haspollTransaction(v17.4.0). - It throws on any send status other than
PENDING, soTRY_AGAIN_LATERandDUPLICATEread as failures. - A failed transaction is thrown as a string containing raw
resultXdr.
Change needed:
Teach the SDK's contract client instead of the hand-written loop, or at least use the SDK's polling and return value. Link the SDK's "Invoke a Contract" guide for the full version.
Correct reference:
- Contract client (v17.4.0):
Client.fromandAssembledTransaction.signAndSend - Polling (v17.4.0):
rpc.Server.pollTransaction - Return value already parsed on the response (v17.4.0):
returnValueinrpc/api.ts - v17 XDR changes (v17.4.0):
docs/migration/xdr-migration.md - SDK guide (current docs, v17): https://stellar.github.io/js-stellar-sdk/guides/06-invoke-a-contract/
How to check the fix:
- Run the updated counter example against testnet with
@stellar/stellar-sdk17.x installed: increment succeeds and the new count is shown. - No method-style XDR accessors are left in the snippet (
.v4(),.sorobanMeta(),.switch(),.value()). - No hand-written polling loop is left; waiting goes through the SDK.
- A failed call (for example, an unfunded account) shows a readable error, not raw XDR.
pnpm validatepasses and the page renders on the preview deploy.- All SDK links in the page resolve.
Why it matters: This is the snippet the hand-written pipelines in HackMeridian 2026 repos match, often through AI tools reproducing it. 74 repos wrote their own build, simulate, send and poll file, and 31 wrote their own polling loop.
Related: #2564 (cross-links from JS tutorials to the SDK docs). The same page teaches the deprecated stellar contract bindings typescript command at line 820; that's a separate issue. The SDK's own send step also throws on anything but PENDING (v17.4.0 sent_transaction.ts#L85), so full TRY_AGAIN_LATER and DUPLICATE handling needs an SDK change too.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
I saw this issue. Nobody has called me in yet, so I will not act on it.
How to reach me:
bot:takelabel, or assign @kaankacar, @ElliotFriend or @wmendes.bot:hands-offlabel.oceans404 commentedon Nov 1, 2026
/triage
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
Working this because @oceans404 added bot:take.
I am checking the claims against SDK v17 now. I will report back with a PR or a question.
stellar-doxie commentedon Nov 1, 2026
🤖 Automated message from the Stellar Triage Bot.
Working this because @oceans404 added bot:take.
I opened #2975. The claims check out against SDK v17.4.0.
pollTransaction, checks the send status and readsreturnValuewithscValToNative.e.value.u32()in the events snippet, which throws in v17 too.