Repository navigation
docs: make the SDK example runnable after a default setup - #151
Open
Adekurnia1988 wants to merge 1 commit into
Open
Adekurnia1988 wants to merge 1 commit into
Adekurnia1988 wants to merge 1 commit into
Conversation
The README and docs/sdk.md examples created the client with
account "researcher", but a default `vapi setup` derives an account
named "main", so the example failed immediately with
"No wallet named researcher. This machine has: main."
The examples also paid a hardcoded id ("base-dex-volume") that does
not come from the search result printed just above it; search items
carry a `ref`, and pay resolves ids through the marketplace ref
lookup. Pass the first result's ref so search and pay connect.
Verified against vapi-network 0.17.5 on Node 24: the old example
throws on line 1; with account "main" the client is created and
search returns listings with refs.
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.
What was wrong
The SDK example in
README.mdanddocs/sdk.mdcreated the client withaccount: "researcher". A defaultvapi setupderives an account namedmain, so running the example verbatim after following the quickstart fails on the first line:The example then paid a hardcoded id (
"base-dex-volume") that does not come from the search result printed just above it. Search items carry aref, andpayresolves ids through the marketplace ref lookup (findMarketplaceApiByRef), so the example should pass the first result'sref.Fix
account: "researcher"→account: "main"in both examples (the accountvapi setupcreates).pay({ id: "base-dex-volume", ... })→ takelistings[0].reffrom the search result and pay that, so search and pay connect.Verification
Tested with
vapi-network@0.17.5on Node v24.22.1 (Ubuntu 24.04) against a vault with the defaultmainaccount:No wallet named researcher. This machine has: main.call.search("Base DEX volume")returns listings withrefvalues (the paying call itself was not executed in my test run).Background: #150