Skip to content

Conversation

@DannyFi
Copy link
Contributor

@DannyFi DannyFi commented Jan 23, 2026

Summary by CodeRabbit

  • New Features

    • Added interactive Alt Fee demos for quick start, token querying, and chain configuration viewing.
  • Documentation

    • Updated SDK documentation with new demo components and revised example values and tokens.
  • Bug Fixes

    • Updated RPC endpoints to new domain across documentation and configurations.
  • Chores

    • Enhanced SEO metadata and added new dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@DannyFi DannyFi requested a review from a team as a code owner January 23, 2026 11:31
@DannyFi DannyFi requested review from r3aker86 and removed request for a team January 23, 2026 11:31
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
pre-rail 0843253 Jan 23 2026, 11:31 AM

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

This PR updates documentation configuration with SEO enhancements, adds three new interactive demo components for Alt Fee features on Morph, updates RPC endpoint URLs across multiple configuration files, introduces viem dependencies, applies new Alt Fee styling, and makes minor fixes to existing components and documentation.

Changes

Cohort / File(s) Summary
Configuration & SEO
config.json, docusaurus.config.js
Removed trailing slash from docs URL in config.json. Introduced SEO constants (SITE_URL, SITE_NAME, DEFAULT_TITLE, etc.) and expanded Docusaurus config with comprehensive Open Graph, Twitter Card, and hreflang metadata; replaced hard-coded values with constants.
Alt Fee Demo Components
src/components/AltFee/AltFeeQuickStartDemo.tsx, src/components/AltFee/QuerySupportedTokensDemo.tsx, src/components/AltFee/ChainConfigDemo.tsx
Added three new interactive React components: AltFeeQuickStartDemo for private-key-based transaction construction with Alt Fee gas selection; QuerySupportedTokensDemo for querying token registry on-chain; ChainConfigDemo for displaying network/chain configuration. All use viem for blockchain interactions.
Network & RPC Endpoints
src/components/ApiExplorer/configs/networks.ts, src/components/ApiExplorer/supported.json
Updated RPC URLs from morphl2.io domain to morph.network for both mainnet and hoodi testnet endpoints.
Dependencies
package.json
Added @morph-network/viem (^0.1.0) and viem (^2.44.4) dependencies.
Documentation
docs/build-on-morph/sdk/js-sdk.mdx
Added embedded demo component markers, updated Morph Hoodi Testnet RPC URL, replaced hard-coded private key with variable reference, adjusted example amounts (0.01 → 0.001), and updated Alt Fee token registry IDs (6 → 4 for USDT).
Styling
src/css/figma-overrides.scss
Introduced comprehensive Alt Fee component styling: responsive form layouts, card containers, input/select fields, toolbar, status messages, footnotes, and table styling with media query support for mobile.
Minor Fixes
src/components/MarkdownActionsDropdown/index.js, src/theme/SearchBar/index.js
Corrected React prop naming (fillRule, className) in SVG icon; removed redundant social metadata meta tags from SearchBar.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Playground #116 — Extends ApiExplorer network configuration and related documentation pages with similar network entries and RPC endpoint handling.
  • New doc style #109 — Modifies the same site configuration files (config.json, docusaurus.config.js) and network RPC endpoints.

Suggested reviewers

  • r3aker86
  • MarvelFisher

Poem

🐰 A tale of networks optimized and fees made simple,
With viem's magic wand, contracts now respond,
RPC endpoints shimmer on morph.network's bond,
Demo components hop across the docs so nimble,
SEO tags dance, while Alt Fees make blockchain less... cynical!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Alt fee Demo & SEO' accurately reflects the pull request's main changes: it adds Alt Fee demo components and implements comprehensive SEO enhancements throughout the documentation site.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@DannyFi DannyFi self-assigned this Jan 23, 2026
@DannyFi DannyFi requested review from BTCB and MarvelFisher January 23, 2026 11:34
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
docs/build-on-morph/sdk/js-sdk.mdx (2)

288-291: Inconsistent tokenID value in comment.

The comment on line 290 shows tokenID: 6 but all other examples in this document now use feeTokenID: 4 for USDT. Update this for consistency.

Suggested fix
-  // => [{ tokenID: 6, tokenAddress: "0x..." }, ...]
+  // => [{ tokenID: 4, tokenAddress: "0x..." }, ...]

503-508: Inconsistent tokenID in example output.

The example output shows tx.feeTokenID as 6 but the documentation consistently uses 4 for USDT elsewhere. Update for consistency.

Suggested fix
 const tx = parseAltFeeTransaction("0x7f...");

-console.log(tx.feeTokenID);  // 6
+console.log(tx.feeTokenID);  // 4
 console.log(tx.feeLimit);    // 252637086960555000n
 console.log(tx.type);        // "altFee"
🤖 Fix all issues with AI agents
In `@docusaurus.config.js`:
- Around line 195-201: The static canonical link entry using tagName:'link' with
attributes.rel='canonical' and href=SITE_URL should be removed or replaced so
Docusaurus can generate per-page canonicals; locate the headTags (or similar
static head injection) where the object with attributes {rel: 'canonical', href:
SITE_URL} is added and either delete that object or change the logic to compute
the page-specific canonical (e.g., derive href from metadata/router) so the
canonical points to each page rather than SITE_URL.

In `@package.json`:
- Line 28: The package entry "@morph-network/viem" in package.json cannot be
resolved; either remove or replace that dependency with a publicly available
package (for example the upstream "viem" or another maintained fork), or change
the dependency value to a reachable source (a git URL or valid registry URL),
and if it's a private package configure the private registry in .npmrc/CI (or
add authentication) so npm install can fetch it; update package.json to the
chosen valid spec, regenerate package-lock.json/yarn.lock, and verify CI
installs succeed (refer to the dependency string "@morph-network/viem" when
editing).

In `@src/components/AltFee/AltFeeQuickStartDemo.tsx`:
- Around line 116-118: The hardcoded gas parameters in AltFeeQuickStartDemo
(gas: 100000n, maxFeePerGas: 15000000n, maxPriorityFeePerGas: 14000000n) can
underpay transactions; instead call the provider's estimateGas (or use
signer.estimateGas/populateTransaction then provider.estimateGas) to compute
gasLimit, fetch fee data via provider.getFeeData() to derive maxFeePerGas and
maxPriorityFeePerGas, and apply BigInt conversions; also include a sensible
fallback (larger constants) if estimation fails and ensure these computed values
are used when constructing the transaction before sending.

In `@src/components/AltFee/QuerySupportedTokensDemo.tsx`:
- Around line 4-8: The import list is missing morphMainnet which causes
incorrect chain selection; update the import statement that currently includes
morphHoodiTestnet, TOKEN_REGISTRY_PROXY_ADDRESS, and tokenRegistryAbi to also
import morphMainnet so the component can support mainnet selection (i.e., add
morphMainnet alongside morphHoodiTestnet in the same import).
- Around line 37-40: The chain passed to createPublicClient is hardcoded to
morphHoodiTestnet causing testnet to be used even when mainnet is selected;
update the createPublicClient call to pick the chain based on the current
network value (e.g., choose morphHoodiMainnet when network indicates mainnet and
morphHoodiTestnet for testnet) and keep rpcUrl(network) as-is; specifically
modify the createPublicClient invocation in QuerySupportedTokensDemo to use a
conditional or mapping (referencing createPublicClient, morphHoodiTestnet, and
the mainnet variant like morphHoodiMainnet) so the chain matches the selected
network.
🧹 Nitpick comments (1)
src/components/AltFee/AltFeeQuickStartDemo.tsx (1)

261-262: Remove empty <div> element.

This empty div serves no purpose and should be removed.

Suggested fix
         </div>
-        <div>
-        </div>
       </div>

Comment on lines +195 to +201
{
tagName: 'link',
attributes: {
rel: 'canonical',
href: SITE_URL,
},
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Static canonical URL may harm SEO.

This canonical link always points to the site root (SITE_URL) for every page. For proper SEO, each page should have a canonical URL pointing to itself to prevent duplicate content issues.

Docusaurus typically handles canonical URLs automatically per-page. This static headTags entry may override that behavior.

Consider removing this static canonical tag and letting Docusaurus handle canonicals dynamically, or verify this is intentional for your use case.

Suggested removal
-    {
-      tagName: 'link',
-      attributes: {
-        rel: 'canonical',
-        href: SITE_URL,
-      },
-    },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
tagName: 'link',
attributes: {
rel: 'canonical',
href: SITE_URL,
},
},
🤖 Prompt for AI Agents
In `@docusaurus.config.js` around lines 195 - 201, The static canonical link entry
using tagName:'link' with attributes.rel='canonical' and href=SITE_URL should be
removed or replaced so Docusaurus can generate per-page canonicals; locate the
headTags (or similar static head injection) where the object with attributes
{rel: 'canonical', href: SITE_URL} is added and either delete that object or
change the logic to compute the page-specific canonical (e.g., derive href from
metadata/router) so the canonical points to each page rather than SITE_URL.

"@docusaurus/theme-common": "3.1.1",
"@docusaurus/theme-search-algolia": "3.1.1",
"@mdx-js/react": "3.0.1",
"@morph-network/viem": "^0.1.0",
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the latest version and metadata for `@morph-network/viem`
npm view `@morph-network/viem` versions --json 2>/dev/null | tail -10
npm view `@morph-network/viem` version 2>/dev/null
npm view `@morph-network/viem` dist-tags 2>/dev/null

Repository: morph-l2/morph-doc

Length of output: 343


🏁 Script executed:

#!/bin/bash
# Read the package.json to see the full dependency entry for `@morph-network/viem`
cat package.json | grep -A 2 -B 2 "@morph-network/viem"

Repository: morph-l2/morph-doc

Length of output: 239


🏁 Script executed:

#!/bin/bash
# Check for .npmrc or npm configuration
ls -la | grep -E "^\.|npmrc|yarnrc"
cat .npmrc 2>/dev/null
cat .yarn/config.cjs 2>/dev/null

# Search for references to morph-network/viem in the codebase
rg "@morph-network/viem" --type json --max-count 10

Repository: morph-l2/morph-doc

Length of output: 111


@morph-network/viem dependency cannot be resolved.

The package is not found in the public npm registry and no private registry or alternative source is configured. This dependency will fail during npm install. Either configure access to the registry where this package is published, or use a git URL if it's a private repository.

🤖 Prompt for AI Agents
In `@package.json` at line 28, The package entry "@morph-network/viem" in
package.json cannot be resolved; either remove or replace that dependency with a
publicly available package (for example the upstream "viem" or another
maintained fork), or change the dependency value to a reachable source (a git
URL or valid registry URL), and if it's a private package configure the private
registry in .npmrc/CI (or add authentication) so npm install can fetch it;
update package.json to the chosen valid spec, regenerate
package-lock.json/yarn.lock, and verify CI installs succeed (refer to the
dependency string "@morph-network/viem" when editing).

Comment on lines +116 to +118
gas: 100000n,
maxFeePerGas: 15000000n,
maxPriorityFeePerGas: 14000000n,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Hardcoded gas parameters may cause transaction failures.

The fixed values (gas: 100000n, maxFeePerGas: 15000000n, maxPriorityFeePerGas: 14000000n) are quite low and could result in:

  • Insufficient gas for certain transfers
  • Transactions stuck in the mempool if network base fee exceeds 15 gwei

Consider estimating gas dynamically or using more generous defaults for a demo.

Suggested improvement using gas estimation
+      const gasEstimate = await publicClient.estimateGas({
+        account: account.address,
+        to: recipient,
+        value,
+      });
+
+      const feeData = await publicClient.estimateFeesPerGas();
+
       const hash = await walletClient.sendTransaction({
         account,
         to: recipient,
         value,
         nonce,
-        gas: 100000n,
-        maxFeePerGas: 15000000n,
-        maxPriorityFeePerGas: 14000000n,
+        gas: gasEstimate,
+        maxFeePerGas: feeData.maxFeePerGas,
+        maxPriorityFeePerGas: feeData.maxPriorityFeePerGas,
🤖 Prompt for AI Agents
In `@src/components/AltFee/AltFeeQuickStartDemo.tsx` around lines 116 - 118, The
hardcoded gas parameters in AltFeeQuickStartDemo (gas: 100000n, maxFeePerGas:
15000000n, maxPriorityFeePerGas: 14000000n) can underpay transactions; instead
call the provider's estimateGas (or use signer.estimateGas/populateTransaction
then provider.estimateGas) to compute gasLimit, fetch fee data via
provider.getFeeData() to derive maxFeePerGas and maxPriorityFeePerGas, and apply
BigInt conversions; also include a sensible fallback (larger constants) if
estimation fails and ensure these computed values are used when constructing the
transaction before sending.

Comment on lines +4 to +8
import {
morphHoodiTestnet,
TOKEN_REGISTRY_PROXY_ADDRESS,
tokenRegistryAbi,
} from "@morph-network/viem";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add morphMainnet import to fix the chain selection issue.

The import needs to include morphMainnet to properly support the mainnet network option.

Suggested fix
 import {
   morphHoodiTestnet,
+  morphMainnet,
   TOKEN_REGISTRY_PROXY_ADDRESS,
   tokenRegistryAbi,
 } from "@morph-network/viem";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import {
morphHoodiTestnet,
TOKEN_REGISTRY_PROXY_ADDRESS,
tokenRegistryAbi,
} from "@morph-network/viem";
import {
morphHoodiTestnet,
morphMainnet,
TOKEN_REGISTRY_PROXY_ADDRESS,
tokenRegistryAbi,
} from "@morph-network/viem";
🤖 Prompt for AI Agents
In `@src/components/AltFee/QuerySupportedTokensDemo.tsx` around lines 4 - 8, The
import list is missing morphMainnet which causes incorrect chain selection;
update the import statement that currently includes morphHoodiTestnet,
TOKEN_REGISTRY_PROXY_ADDRESS, and tokenRegistryAbi to also import morphMainnet
so the component can support mainnet selection (i.e., add morphMainnet alongside
morphHoodiTestnet in the same import).

Comment on lines +37 to +40
const publicClient = createPublicClient({
chain: morphHoodiTestnet,
transport: http(rpcUrl(network)),
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Chain configuration is hardcoded to testnet regardless of network selection.

The chain parameter always uses morphHoodiTestnet even when mainnet is selected. This could cause chain ID mismatches or unexpected behavior when querying the mainnet.

Suggested fix
+import {
+  morphHoodiTestnet,
+  morphMainnet,
+  TOKEN_REGISTRY_PROXY_ADDRESS,
+  tokenRegistryAbi,
+} from "@morph-network/viem";

+// Inside handleQuery:
       const publicClient = createPublicClient({
-        chain: morphHoodiTestnet,
+        chain: network === "mainnet" ? morphMainnet : morphHoodiTestnet,
         transport: http(rpcUrl(network)),
       });
🤖 Prompt for AI Agents
In `@src/components/AltFee/QuerySupportedTokensDemo.tsx` around lines 37 - 40, The
chain passed to createPublicClient is hardcoded to morphHoodiTestnet causing
testnet to be used even when mainnet is selected; update the createPublicClient
call to pick the chain based on the current network value (e.g., choose
morphHoodiMainnet when network indicates mainnet and morphHoodiTestnet for
testnet) and keep rpcUrl(network) as-is; specifically modify the
createPublicClient invocation in QuerySupportedTokensDemo to use a conditional
or mapping (referencing createPublicClient, morphHoodiTestnet, and the mainnet
variant like morphHoodiMainnet) so the chain matches the selected network.

@DannyFi DannyFi changed the title Alt fee Demo Alt fee Demo & SEO Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants