Repository navigation
docs(tutorials): connect a CIP-30 wallet and send a first payment on preview - #418
Open
IanoNjuguna wants to merge 6 commits into
Open
IanoNjuguna wants to merge 6 commits into
IanoNjuguna wants to merge 6 commits into
Conversation
IanoNjuguna
force-pushed
the
fix/tutorial-code-samples
branch
from
November 22, 2026 12:13
927195f to
47b82e9
Compare
…preview The Tutorials section had one hands-on guide, a Haskell payment detector against a local emulator. There was nothing for the browser path a newcomer actually starts with: a wallet extension, a provider, and a transaction the wallet signs. Adds "Connect a Wallet and Send Your First Payment", built on the current Mesh API rather than the older Transaction class: MeshCardanoBrowserWallet.getInstalledWallets() / enable() / getNetworkId() MeshTxBuilder.txOut().changeAddress().selectUtxosFrom().complete() wallet.signTx(tx, false) then wallet.submitTx(tx) BlockfrostProvider.onTxConfirmed() Everything runs on preview testnet, addresses start addr_test1, and the faucet, Blockfrost and explorer links are the current ones. The failures a first-timer hits get their own troubleshooting entries: wallet list empty until reload, wrong network, Blockfrost 403 from a mainnet key, funds not yet arrived, stale UTxOs after a submit, collateral (and why a plain payment does not need it), and a rejected signature. Also lists it under Tutorials in getting-started.md, next to the existing guide, with a trailing-slash route. Verified on a local build: the page renders with 11 code blocks and the warning admonition, the autogenerated sidebar carries it under Tutorials, the breadcrumb resolves, and there is no horizontal overflow at 1280 or 390. Fixes IntersectMBO#265 Co-authored-by: Sahil Singh <180702365+sadSanta-07@users.noreply.github.com>
IanoNjuguna
force-pushed
the
fix/tutorial-code-samples
branch
from
November 22, 2026 13:52
47b82e9 to
997325a
Compare
7 of 10 tasks
The page carried a frontmatter title, sidebar label and position, where the other tutorial in this folder has none and opens on a prose H1. It now reads as the same set as local-cardano-payment-detector.md: an H1 that names the build, two paragraphs of why, then named steps. Each heading that held several code blocks is split into its own subsection (The Building Blocks, What Is Installed, Asking for Permission, Guarding the Network, and so on), and every block is followed by the sentence that says what it does. Where the old page explained a thing before showing it (the short string amounts, the change address, what complete() reaches the network for), the explanation now sits under the block that demonstrates it. Two content moves: the provider key section moves from after the full component up into setup, where a reader needs it, and the full component gains try/catch and a pending flag so it does the error handling the prose asks for. A Summary closes the page, matching the sibling. No API changed. MeshCardanoBrowserWallet, MeshTxBuilder and BlockfrostProvider method names were checked against @meshsdk/wallet@2.0.0-beta.11 and @meshsdk/core@1.9.1 type definitions, and every external link returns 200.
The page tells a reader to use MeshCardanoBrowserWallet, getUtxosMesh and
MeshTxBuilder({ fetcher }), all of which postdate what a coding assistant
learned. Mesh ships an MCP server for that gap, so the page now carries it as
an optional step between setup and the first wallet call, where a reader needs
it rather than at the end.
The configuration is the one Mesh publishes, read off the Cursor install
deeplink on meshjs.dev/ai/mcp: npx -y meshjs-mcp with API_KEY and MODEL, and
the note that VS Code spells the container `servers` where Claude Code and
Cursor use `mcpServers`.
The warning is deliberate, because the step does not work end to end today:
meshjs-mcp@1.1.1 handshakes and lists askDocs, askDocs posts to
mimir-api.meshjs.dev which has no DNS record, and meshjs.dev/api/mcp/ask
answers 404. A reader who runs it gets "Couldn't match documentation" on every
call, so the section says so and gives them meshjs.dev/llms-full.txt and the
.md twin of any page instead.
Most people reading this will be driving a coding agent, and the page led with the wallet walkthrough while keeping the MCP setup as an optional aside two thirds of the way into setup. That order is backwards: an agent that has not read Mesh's docs writes BrowserWallet and the Transaction class, and then every snippet on the page is wrong in the same quiet way. Step 1 is now handing the agent the documentation (the MCP config, the VS Code `servers` difference, and the llms-full.txt fallback for when the hosted service answers nothing), followed by the question to ask it whose answer changed between versions. The build then runs as seven numbered steps, each closing with the prompt to give the agent and the specific shape to reject. The intro now carries the four facts an agent gets wrong, so a reader can audit the output before the first wallet call. Checked against the packages rather than the prose: @meshsdk/wallet@2.0.0-beta.11 exports MeshCardanoBrowserWallet and CardanoBrowserWallet and has no BrowserWallet (that name survives in the 1.9.1 wallet that @meshsdk/core re-exports), the Transaction class still ships in @meshsdk/transaction, and Mesh's current docs build transactions with MeshTxBuilder. So the page says "previous class" and "no longer taught" rather than calling either one gone.
Step 1 opened with the MCP config and treated the llms-full.txt download as something to fall back to when the MCP failed. That is the wrong order twice over: the file works today and the MCP does not, and a downloaded copy is what an agent can actually grep and cite without a key or a network call. So Step 1 is now the file: fetch meshjs.dev/llms-full.txt into docs/, keep it out of git with .gitignore, and give the agent one sentence to obey, the same sentence in AGENTS.md or CLAUDE.md so it survives a new session. The markdown twin hint stays for the follow-up question. The MCP server moves to its own subsection at the end of the step, complete with the verified note that its hosted service answers nothing today, so the config is there for when it is back rather than being the thing a reader tries first.
The hosted service behind it does not resolve, so the section documented a setup a reader cannot use, and the warning explaining that took more room than the instructions it warned about. Step 1 keeps the method that works today: the llms-full.txt download, the sentence for the agent, and the markdown twin for anything the file does not settle. Also finishes the language: the intro promised "Mesh's live documentation" when what the reader gets is a local snapshot.
Contributor
|
Hey @IanoNjuguna, huge thanks for putting this together and adding me as co-author! Really appreciate you keeping my earlier claim in mind, guide looks super clean and well-structured. |
This branch has not been deployed
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
The Tutorials section has one hands-on guide: a Haskell payment detector against a local emulator. That covers the backend path. It does not cover the one a newcomer usually starts with, which is a browser wallet, a provider, and a transaction the wallet signs.
This adds Connect a Wallet and Send Your First Payment, a single page that walks the whole path on preview testnet:
MeshTxBuilderWritten against the current Mesh API rather than the older
Transactionclass:MeshCardanoBrowserWalletfrom@meshsdk/wallet,MeshTxBuilderandBlockfrostProviderfrom@meshsdk/core. Every method named in the page is one Mesh documents today, and the page links to that documentation rather than restating it.Fixes #265. It meets every acceptance criterion:
website/docs/tutorials/npm run buildsucceedsWhere this could go further
The page is a single happy path, and #265 is assigned to @sadSanta-07, who is credited as a co-author on the commit. Roughly in order of value:
unitbeing policy ID plus asset name in hex needs a worked example.enable():eternl,lace,nami,flint,gerowallet,typhoncip30.getCollateralMesh()example for a reader whose next step is a Plutus call./tx/<hash>pattern; a real link would be better.Type of Change
Testing
Checklist
Verification
Served and inspected at 1280 and 390:
:::warningaboutaddr_test1vsaddr1renders as an admonitionExternal links checked with
curl, not assumed:preview.cardanoscan.ioanswers 403 to a scripted request, so the page links cexplorer only and mentions pasting the hash into a block explorer rather than promising a specific URL shape that I could not verify.Notes
/tx/<hash>URL, because the explorer's path pattern is not documented anywhere I could confirm.fix/tutorial-code-samplesis the branch Update code samples so tutorials build and run #301 names for tutorial changes. It existed but carried nothing (0 commits ahead ofmain, 168 behind), so the branch was moved onto currentmainbefore this commit.