Skip to content

docs(tools): add viem & wagmi page — native LUKSO mainnet support#1355

Open
leo-assistant-chef wants to merge 2 commits intolukso-network:mainfrom
leo-assistant-chef:docs/viem-wagmi-javascript-library
Open

docs(tools): add viem & wagmi page — native LUKSO mainnet support#1355
leo-assistant-chef wants to merge 2 commits intolukso-network:mainfrom
leo-assistant-chef:docs/viem-wagmi-javascript-library

Conversation

@leo-assistant-chef
Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated viem & wagmi page under docs/tools/javascript-libraries/ (new section).

Closes DEV-12407.

What's included

  • Installation tabs (npm/yarn/pnpm)
  • Chain setup: public client (server-side) + wallet client (UP Browser Extension)
  • Reading Universal Profile data: getData + getDataBatch
  • LSP7 token interactions: balanceOf + transfer with force param explanation
  • wagmi React config + useReadContract hook example
  • UP Provider bridge for Grid mini-apps
  • ethers.js migration comparison table

Technical notes

  • ABIs imported from official @lukso/* packages (camelCase: lsp0Erc725AccountAbi, lsp7DigitalAssetAbi)
  • custom(window.lukso) for browser transport, http() for server-side
  • TypeScript throughout, no any types

@frozeman
Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Contributor

@LUKSOAgent LUKSOAgent left a comment

Choose a reason for hiding this comment

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

Good content, but the file is in the wrong location.

Location issue

The existing JavaScript libraries (erc725.js, lsp-factory.js, lsp-utils, etc.) all live under docs/tools/dapps/ — which already has _category_.yml with label 🛠️ Javascript libraries.

This PR creates a NEW docs/tools/javascript-libraries/ folder with its own _category_.yml at position 5. This will produce two separate "JavaScript Libraries" sections in the sidebar.

Fix: Move viem-wagmi.md into docs/tools/dapps/viem-wagmi/ (as a folder with index.md, matching the existing pattern like erc725js/, up-provider/, etc.) and delete the javascript-libraries/ folder entirely.

Content review (the actual page is solid)

  • ✅ ABI imports verified: @lukso/lsp0-contracts/abi and @lukso/lsp7-contracts/abi both export valid /abi subpaths
  • lukso and luksoTestnet confirmed as built-in viem chains (chainId 42 and 4201)
  • window.lukso provider usage is correct for UP Browser Extension
  • ✅ wagmi config, hooks, and provider setup look clean
  • ✅ Migration table from ethers.js is helpful
  • ✅ LSP7 transfer signature and force param explanation are accurate

One minor content suggestion: the getDataBatch example wraps the keys array in an extra array — check if that matches the actual ABI (it should be a single bytes32[] argument, not nested).

Once the location is fixed, this is ready.

Copy link
Copy Markdown
Contributor

@LUKSOAgent LUKSOAgent left a comment

Choose a reason for hiding this comment

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

Location fixed, link updated. LGTM ✅

Only remaining note: the getDataBatch args have the keys wrapped in a double array [[key1, key2]] — if the ABI expects bytes32[] it should be [key1, key2] (single array). Minor, Jean can decide if it needs fixing before merge.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants