Document Bubblegum V2 sfbp inheritance - #533
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 51 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
Summary by CodeRabbit
WalkthroughBubblegum V2 documentation now describes inherited MPL-Core royalties, the ChangesBubblegum V2 inherited royalties
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md (1)
517-537: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winTranslate the Notes/Glossary block for the Chinese locale.
This section is still English, but the locale guideline requires page body prose to be translated. Please localize the notes and glossary entries here, or explicitly split out any intentionally shared English text.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md` around lines 517 - 537, The Notes/Glossary block is still written in English, so localize that prose for the zh page or clearly mark any terms meant to remain shared English. Update the content in the markdown section around the Notes and Glossary entries, keeping the terminology consistent with the existing Chinese locale and preserving symbols like MetadataArgsV2, LeafSchemaV2, and keccak-256 where appropriate.Source: Coding guidelines
src/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.md (1)
127-161: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winTranslate the Notes/Glossary block for the Korean locale.
These paragraphs and table entries are still English, but the locale guideline requires page body prose to be translated. Please localize this section, or explicitly mark any shared English text if that is intentional. As per coding guidelines, translate page body prose in locale pages; only keywords/about/programmingLanguage/proficiencyLevel, code examples, Markdoc component names, and date fields stay in English.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.md` around lines 127 - 161, The Notes and Glossary content in this Korean locale page is still in English and needs to be localized to match the rest of the page. Translate the prose and table definitions in the markdown block while keeping required technical symbols like updateMetadataV2, UpdateArgsArgs, currentMetadata, and SELLER_FEE_BASIS_POINTS_INHERIT unchanged; use the surrounding FAQ style in this document as a guide for terminology consistency.Source: Coding guidelines
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md (1)
127-161: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winTranslate the Notes/Glossary block for the Chinese locale.
This section is still English, but the locale guideline requires page body prose to be translated. Please localize the notes and glossary entries here, or explicitly split out any intentionally shared English text. As per coding guidelines, translate page body prose in locale pages; only keywords/about/programmingLanguage/proficiencyLevel, code examples, Markdoc component names, and date fields stay in English.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md` around lines 127 - 161, The Notes and Glossary content in this Chinese locale page is still written in English and should be localized to match the page language. Update the prose under the Notes section and translate the glossary term definitions in this document, using the existing Markdown structure and symbols like UpdateArgsArgs, currentMetadata, and SELLER_FEE_BASIS_POINTS_INHERIT as needed. Keep only technical identifiers and code-like names in English; if any text is intentionally shared, separate it explicitly rather than leaving mixed-language body prose.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/pages/ja/smart-contracts/bubblegum-v2/faq.md`:
- Around line 155-182: The FAQ entry for the inherited-royalties topic explains
caveats but is missing the required `## Notes` block. Update this section in the
`inherited-royalties` content so the caveats and compatibility details are moved
into a `Notes` subsection, keeping the guidance alongside the existing
`getAssetWithProof`, `updateMetadataV2`, and `setCollectionV2` explanations.
Ensure the page includes a clear `## Notes` heading for these implementation
caveats.
In `@src/pages/ko/smart-contracts/bubblegum-v2/faq.md`:
- Around line 154-182: Add the missing `## Notes` section on this FAQ page so it
does not jump straight from the summary into the FAQ content. Move the
inherited-royalties caveats into that `## Notes` section and keep the FAQ
entries below it, using the existing `faq.md` structure and headings like `##
하나의 트리에 cNFT를 몇 개나 저장할 수 있나요?` and `## cNFT가 MPL-Core 컬렉션에서 로열티를 상속할 수 있나요?` as
anchors for placement.
In `@src/pages/zh/smart-contracts/bubblegum-v2/faq.md`:
- Around line 160-188: The FAQ page is missing the required Notes section, so
the inherited-royalties caveats are currently placed directly under the FAQ
content. Add a dedicated `## Notes` section in this document and move the
existing compatibility/caveat material there, keeping the FAQ entries themselves
under the current question headings. Use the existing `inherited-royalties`
content as the source and ensure the new section sits between the
summary/context and the FAQ list.
---
Outside diff comments:
In `@src/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.md`:
- Around line 127-161: The Notes and Glossary content in this Korean locale page
is still in English and needs to be localized to match the rest of the page.
Translate the prose and table definitions in the markdown block while keeping
required technical symbols like updateMetadataV2, UpdateArgsArgs,
currentMetadata, and SELLER_FEE_BASIS_POINTS_INHERIT unchanged; use the
surrounding FAQ style in this document as a guide for terminology consistency.
In `@src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md`:
- Around line 517-537: The Notes/Glossary block is still written in English, so
localize that prose for the zh page or clearly mark any terms meant to remain
shared English. Update the content in the markdown section around the Notes and
Glossary entries, keeping the terminology consistent with the existing Chinese
locale and preserving symbols like MetadataArgsV2, LeafSchemaV2, and keccak-256
where appropriate.
In `@src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md`:
- Around line 127-161: The Notes and Glossary content in this Chinese locale
page is still written in English and should be localized to match the page
language. Update the prose under the Notes section and translate the glossary
term definitions in this document, using the existing Markdown structure and
symbols like UpdateArgsArgs, currentMetadata, and
SELLER_FEE_BASIS_POINTS_INHERIT as needed. Keep only technical identifiers and
code-like names in English; if any text is intentionally shared, separate it
explicitly rather than leaving mixed-language body prose.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: bea67881-ce00-4d35-ac9d-02ada7145746
📒 Files selected for processing (21)
src/pages/ja/smart-contracts/bubblegum-v2/collections.mdsrc/pages/ja/smart-contracts/bubblegum-v2/faq.mdsrc/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/ja/smart-contracts/bubblegum-v2/index.mdsrc/pages/ja/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.mdsrc/pages/ko/smart-contracts/bubblegum-v2/collections.mdsrc/pages/ko/smart-contracts/bubblegum-v2/faq.mdsrc/pages/ko/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/ko/smart-contracts/bubblegum-v2/index.mdsrc/pages/ko/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/ko/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.mdsrc/pages/zh/smart-contracts/bubblegum-v2/collections.mdsrc/pages/zh/smart-contracts/bubblegum-v2/faq.mdsrc/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/zh/smart-contracts/bubblegum-v2/index.mdsrc/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md
danenbm
left a comment
There was a problem hiding this comment.
Left one nit comment but LGTM
| }).sendAndConfirm(umi) | ||
| ``` | ||
|
|
||
| For cNFTs with inherited royalties, prefer `currentMetadata` over `metadata` — see [getAssetWithProof](#getassetwithproof-metadata-vs-currentmetadata) below. |
There was a problem hiding this comment.
Nit: This seems like it could use a small amount more description on why "prefer"
There was a problem hiding this comment.
I've added a sentence that for hashing the currentMetadata is required because of the sentinel
|
@danenbm please rereview, I've added some more details. |
Align Bubblegum V2 and DAS docs with the restored contract: display on main royalty/creators fields, leaf sentinel and creators on _raw.
There was a problem hiding this comment.
Actionable comments posted: 20
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/examples/bubblegum/get-asset-with-proof-inherited/index.js`:
- Around line 12-13: Configure DAS support for both inherited-royalty examples:
update src/examples/bubblegum/get-asset-with-proof-inherited/index.js lines
12-13 and src/examples/bubblegum/update-inherit-royalties/index.js lines 12-13
to use a DAS-enabled endpoint or DAS/UMI plugin setup so getAssetWithProof
receives getAsset and getAssetProof, then regenerate the JavaScript files.
In `@src/examples/bubblegum/update-inherit-royalties/index.js`:
- Around line 12-13: Configure an authority signer in the Umi setup used by the
update-inherit-royalties example before calling sendAndConfirm in main. Update
the createUmi chain in umi.ts to apply the project’s established
keypairIdentity, walletAdapterIdentity, or equivalent signer configuration, then
regenerate the corresponding index.js output so both sources use the same signer
setup.
In `@src/pages/en/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`:
- Around line 24-30: Add the missing “## FAQ” section in the page body and
render the existing frontmatter faqs entries there, then add a “## Notes”
section containing the relevant compatibility caveats. Keep the declared faqs
frontmatter and ensure both sections are included in the document structure.
- Around line 52-63: Add a concise, direct declarative introductory sentence
immediately below each affected heading—“Field map,” “Example DAS response,”
“Detection and display helpers,” and “What not to do”—before its table, code
block, or list. Keep the existing content unchanged and apply the same BLUF
treatment to the additional referenced sections.
In `@src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md`:
- Around line 286-297: Replace the placeholder collection in the currentMetadata
objects with assetWithProof.metadata.collection. Apply this in
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md (lines 286-297),
src/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.md (lines 287-298), and
both update-cnfts.md files at lines 96-106; in the English and Japanese
update-cnfts.md examples, also set coreCollection from the same leaf/provided
collection so both fields remain consistent.
In `@src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md`:
- Around line 159-160: Add the explicit {% `#inherited-royalties` %} anchor to the
FAQ heading near the update-cnfts inherited-royalties section so links from the
English SDK and reading pages resolve correctly; leave the metadata and royalty
update guidance unchanged.
- Line 39: Reduce each Summary block to 3–4 bullets by merging the leaf-metadata
guidance into an existing bullet or removing one bullet. Apply the same
adjustment in src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md (lines
39-39) and src/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.md (lines
39-39), while preserving the guidance to use getAssetWithProof leaf metadata as
updateMetadataV2’s currentMetadata argument.
- Around line 96-106: Import publicKey alongside some from
`@metaplex-foundation/umi` in both update examples:
src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md lines 96-106 and
src/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.md lines 96-106. Ensure
the existing publicKey(...) calls in each example resolve without changing the
update logic.
In `@src/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`:
- Around line 157-164: Add a required empty “## Notes” section before the
related-links heading in both
src/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.md (lines
157-164) and
src/pages/ko/smart-contracts/bubblegum-v2/reading-inherited-royalties.md (lines
157-164), using the locale-appropriate related heading that already follows each
insertion point.
- Around line 24-30: In
src/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.md:24-30,
add a Japanese ## FAQ body section matching the declared faqs entries, or remove
the faqs frontmatter. In
src/pages/ko/smart-contracts/bubblegum-v2/reading-inherited-royalties.md:24-30,
make the same change with a Korean FAQ section or remove faqs; ensure neither
page retains faqs without a corresponding ## FAQ section.
- Line 41: Add the explicit inheriting-royalties-from-the-collection anchor to
the localized mint heading in
src/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.md at
lines 41 and 159-164, src/pages/ja/smart-contracts/bubblegum-v2/faq.md at line
180, and
src/pages/ko/smart-contracts/bubblegum-v2/reading-inherited-royalties.md at
lines 41 and 159-164. Ensure all links using that fragment resolve to the
Japanese and Korean mint sections.
- Around line 52-59: In both Japanese and Korean versions, add a direct
declarative BLUF sentence immediately after each relevant heading:
src/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.md ranges
52-59, 61-70, 90-92, and 147-164, and
src/pages/ko/smart-contracts/bubblegum-v2/reading-inherited-royalties.md ranges
52-59, 61-70, 90-92, and 147-164. Cover the field map, example, helper,
prohibited-actions, and Related sections, preserving the existing tables, code,
lists, links, and equivalent meaning in Korean.
In `@src/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.md`:
- Around line 508-519: Complete the Japanese localization in the
“getAssetWithProof and inherited royalties” section by translating the English
heading and table labels while preserving API identifiers such as
getAssetWithProof, getAsset, getAssetProof, metadata, and rpcAsset. Translate
the remaining descriptive text consistently, and revise “DASを直接読むクライアント” to
clearer Japanese such as “DASを直接読み取るクライアント”.
In `@src/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.md`:
- Around line 159-160: Update the Japanese documentation sentence in the
getAssetWithProof/updateMetadataV2 instructions to clarify that an explicit
numeric updateArgs.sellerFeeBasisPoints value disables inherited royalties,
while some(SELLER_FEE_BASIS_POINTS_INHERIT) enables inheritance.
In `@src/pages/ko/smart-contracts/bubblegum-v2/sdk/javascript.md`:
- Around line 287-302: Update the `updateMetadataV2` examples so
`currentMetadata.collection` reuses `assetWithProof.metadata.collection` rather
than a placeholder. In
`src/pages/ko/smart-contracts/bubblegum-v2/sdk/javascript.md` lines 287-302,
pass `coreCollection` only for collection cNFTs; in
`src/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.md` lines 96-106, mirror
the fetched collection value and omit `coreCollection` for standalone cNFTs.
In `@src/pages/zh/dev-tools/das-api/methods/get-asset.md`:
- Around line 10-11: Qualify all DAS inherited-royalty documentation with the
requirement that collection resolution succeeds: update
src/pages/zh/dev-tools/das-api/methods/get-asset.md lines 10-11,
src/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.md line 59,
src/pages/zh/smart-contracts/bubblegum-v2/faq.md lines 39 and 167-177,
src/pages/zh/smart-contracts/bubblegum-v2/fetch-cnfts.md line 211,
src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md line 300, and
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md lines 33 and 150-152.
State that collection-resolved values populate the display fields only when the
collection is resolved; otherwise describe the fallback where
royalty.basis_points may fall back while royalty.basis_points_raw remains 65535,
and adjust each field-mapping, display, notes, FAQ, and minting statement
accordingly.
In `@src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md`:
- Around line 150-152: Localized English fragment links need explicit anchors:
add {% `#inheriting-royalties-from-the-collection` %} to the minting heading in
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md:150-152 and {%
`#inherited-royalties` %} to the update heading in
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md:159-159. In
src/pages/zh/smart-contracts/bubblegum-v2/faq.md:186-186,
src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md:160-161,
src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md:300-300, and
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md:167-167, keep the
existing minting and update links unchanged so both fragments resolve to these
anchors.
In `@src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`:
- Line 33: Rename the localized page’s `## 摘要` heading to the required `##
Summary` heading, preserving the existing summary content and structure.
- Around line 24-30: The page’s faqs frontmatter must match the document
structure: add a localized ## FAQ section containing the declared questions and
answers, or remove the faqs field if no visible FAQ section is desired. Keep the
selected content consistent with the existing Chinese FAQ entries.
In `@src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md`:
- Around line 96-106: Replace the placeholder collection in currentMetadata
within src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md lines 96-106
with the existing leaf collection value, preserving the option shape used by
nearby Bubblegum V2 examples. Apply the same correction in
src/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.md lines 287-298; both
sites must continue mirroring the leaf’s current metadata.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: cecd3c0f-b649-48f6-9a14-2cfad70ba400
📒 Files selected for processing (37)
src/components/products/bubblegum-v2/index.jssrc/examples/bubblegum/get-asset-with-proof-inherited/index.jssrc/examples/bubblegum/get-asset-with-proof-inherited/umi.tssrc/examples/bubblegum/update-inherit-royalties/index.jssrc/examples/bubblegum/update-inherit-royalties/umi.tssrc/pages/en/dev-tools/das-api/methods/get-asset.mdsrc/pages/en/smart-contracts/bubblegum-v2/faq.mdsrc/pages/en/smart-contracts/bubblegum-v2/fetch-cnfts.mdsrc/pages/en/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/en/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/en/smart-contracts/bubblegum-v2/reading-inherited-royalties.mdsrc/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/en/smart-contracts/bubblegum-v2/update-cnfts.mdsrc/pages/ja/dev-tools/das-api/methods/get-asset.mdsrc/pages/ja/smart-contracts/bubblegum-v2/faq.mdsrc/pages/ja/smart-contracts/bubblegum-v2/fetch-cnfts.mdsrc/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/ja/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/ja/smart-contracts/bubblegum-v2/reading-inherited-royalties.mdsrc/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.mdsrc/pages/ko/dev-tools/das-api/methods/get-asset.mdsrc/pages/ko/smart-contracts/bubblegum-v2/faq.mdsrc/pages/ko/smart-contracts/bubblegum-v2/fetch-cnfts.mdsrc/pages/ko/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/ko/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/ko/smart-contracts/bubblegum-v2/reading-inherited-royalties.mdsrc/pages/ko/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/ko/smart-contracts/bubblegum-v2/update-cnfts.mdsrc/pages/zh/dev-tools/das-api/methods/get-asset.mdsrc/pages/zh/smart-contracts/bubblegum-v2/faq.mdsrc/pages/zh/smart-contracts/bubblegum-v2/fetch-cnfts.mdsrc/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.mdsrc/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.mdsrc/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.mdsrc/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.mdsrc/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md
| "setup": "const umi = createUmi('https://api.devnet.solana.com').use(mplBubblegum())\n\nconst assetId = publicKey('YOUR_ASSET_ID')", | ||
| "main": "const assetWithProof = await getAssetWithProof(umi, assetId, {\n truncateCanopy: true,\n})\n\n// Leaf / hashing value (65535 when inherited)\nconsole.log(assetWithProof.metadata.sellerFeeBasisPoints)\n\n// Display / payout value from DAS main fields\nconsole.log(assetWithProof.rpcAsset.royalty?.basis_points)", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== files =="
git ls-files | rg 'src/examples/bubblegum/(get-asset-with-proof-inherited|update-inherit-royalties)/index' || true
echo "== target lines =="
for f in src/examples/bubblegum/get-asset-with-proof-inherited/index.js src/examples/bubblegum/update-inherit-royalties/index.js; do
echo "--- $f ---"
nl -ba "$f" | sed -n '1,80p'
done
echo "== related TypeScript source mentions =="
fd . src/examples/bubblegum -t f | sed 's#^\./##' | xargs -r -n1 sh -c 'echo "--- $0 ---"; rg -n "getAssetWithProof|api\.devnet\.solana\.com|YOUR_ASSET_ID|DAS|getAsset|getAssetProof|metaplex|Devnet" "$0" || true'Repository: metaplex-foundation/developer-hub
Length of output: 434
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== target lines =="
for f in src/examples/bubblegum/get-asset-with-proof-inherited/index.js src/examples/bubblegum/update-inherit-royalties/index.js; do
echo "--- $f ---"
awk '{printf "%5d\t%s\n", NR, $0}' "$f" | sed -n '1,100p'
done
echo "== matching files =="
find src/examples/bubblegum -name 'index.js' -o -name 'index.ts' | sort | while read -r f; do
echo "--- $f ---"
grep -n -E "getAssetWithProof|api\.devnet\.solana\.com|YOUR_ASSET_ID|DAS|getAsset|getAssetProof|metaplex|Devnet" "$f" || true
doneRepository: metaplex-foundation/developer-hub
Length of output: 28093
🌐 Web query:
Metaplex Bubblegum v2 getAssetWithProof API getAssetAssetProof DAS required provider api.devnet.solana.com DAS
💡 Result:
The getAssetWithProof function is a helper method provided by the @metaplex-foundation/mpl-bubblegum library (part of the Umi framework) designed to simplify interactions with compressed NFTs (cNFTs) [1][2][3]. It automatically fetches both the asset data (via getAsset) and the Merkle tree proof (via getAssetProof) from the Metaplex Digital Asset Standard (DAS) API and formats them into the specific parameters required for Bubblegum V2 write instructions, such as transfers, burns, or updates [1][4][5]. Key technical points regarding your query: 1. Usage and Requirements: You should call getAssetWithProof immediately before any mutation instruction to avoid using stale proof data [1]. When using the Bubblegum Umi library, register the DAS API plugin (.use(dasApi())) to enable the required RPC methods [1][6]. 2. DAS API Providers: The URL api.devnet.solana.com is the standard Solana Devnet RPC endpoint, but it does not natively support Metaplex DAS API methods (like getAsset or getAssetProof) unless the provider explicitly includes DAS support [1][7]. Most developers use specialized RPC providers (such as Helius, Triton, or Shyft) that offer a specific "Digital Asset Standard (DAS)" API endpoint to handle these requests [8][6]. You must configure your Umi instance to point to an RPC provider that supports the DAS method set [6]. 3. Optimization: If you encounter transaction size limitations, you can use the truncateCanopy: true option within getAssetWithProof [5][9]. This optimizes the proof path by removing redundant nodes based on the tree's canopy configuration, helping to keep transaction sizes within protocol limits [5]. Example of basic usage: import { getAssetWithProof, transferV2 } from '@metaplex-foundation/mpl-bubblegum'; import { publicKey } from '@metaplex-foundation/umi'; // Fetch proof and asset data const assetWithProof = await getAssetWithProof(umi, assetId, { truncateCanopy: true }); // Use in write operation await transferV2(umi, {...assetWithProof, leafOwner: umi.identity, newLeafOwner: publicKey('NewOwnerAddress'), }).sendAndConfirm(umi);
Citations:
- 1: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/sdk/javascript
- 2: https://mpl-bubblegum-js-docs.vercel.app/functions/getAssetWithProof.html
- 3: [Umi] Add getAssetWithProof helper mpl-bubblegum#25
- 4: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/fetch-cnfts
- 5: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/faq
- 6: https://www.npmjs.com/package/@metaplex-foundation/digital-asset-standard-api
- 7: https://www.metaplex.com/docs/dev-tools/das-api/methods
- 8: https://docs.triton.one/digital-assets-api/metaplex-digital-assets-api/get-asset-proof
- 9: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/delegate-cnfts
Use a DAS endpoint or DAS plugin in the inherited-royalty examples.
Both examples pass umi into getAssetWithProof, which needs getAsset/getAssetProof (Metaplex DAS) rather than only the standard Solana RPC methods. Replace api.devnet.solana.com with a DAS-enabled URL, or add a DAS/UMI DAS plugin setup, then regenerate the JavaScript files.
src/examples/bubblegum/get-asset-with-proof-inherited/index.js#L12-L13src/examples/bubblegum/update-inherit-royalties/index.js#L12-L13
📍 Affects 2 files
src/examples/bubblegum/get-asset-with-proof-inherited/index.js#L12-L13(this comment)src/examples/bubblegum/update-inherit-royalties/index.js#L12-L13
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/examples/bubblegum/get-asset-with-proof-inherited/index.js` around lines
12 - 13, Configure DAS support for both inherited-royalty examples: update
src/examples/bubblegum/get-asset-with-proof-inherited/index.js lines 12-13 and
src/examples/bubblegum/update-inherit-royalties/index.js lines 12-13 to use a
DAS-enabled endpoint or DAS/UMI plugin setup so getAssetWithProof receives
getAsset and getAssetProof, then regenerate the JavaScript files.
| "setup": "const umi = createUmi('https://api.devnet.solana.com').use(mplBubblegum())\n\nconst assetId = publicKey('YOUR_ASSET_ID')\nconst collectionPublicKey = publicKey('YOUR_COLLECTION_ADDRESS')", | ||
| "main": "const assetWithProof = await getAssetWithProof(umi, assetId, {\n truncateCanopy: true,\n})\n\n// Switch from inherited royalties to an explicit seller fee before removing\n// the cNFT from its collection.\nconst updateArgs: UpdateArgsArgs = {\n sellerFeeBasisPoints: some(550), // explicit 5.5%\n}\n\nawait updateMetadataV2(umi, {\n ...assetWithProof,\n currentMetadata: {\n name: assetWithProof.metadata.name,\n symbol: assetWithProof.metadata.symbol,\n uri: assetWithProof.metadata.uri,\n sellerFeeBasisPoints: assetWithProof.metadata.sellerFeeBasisPoints,\n primarySaleHappened: assetWithProof.metadata.primarySaleHappened,\n isMutable: assetWithProof.metadata.isMutable,\n tokenStandard: assetWithProof.metadata.tokenStandard,\n creators: assetWithProof.metadata.creators,\n collection: some(collectionPublicKey),\n },\n updateArgs,\n coreCollection: collectionPublicKey,\n}).sendAndConfirm(umi)", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== locate target and related files =="
fd -a 'index.js|umi.ts|README.md|package.json' . | sed 's#^\./##' | head -200
echo
echo "== target file =="
cat -n src/examples/bubblegum/update-inherit-royalties/index.js | sed -n '1,120p'
echo
echo "== update-inherit-royalties tree =="
fd -a '' src/examples/bubblegum/update-inherit-royalties | sed 's#^\./##'
echo
echo "== search updateMetadataV2 and identity config in repo =="
rg -n "updateMetadataV2|keypairIdentity|walletAdapterIdentity|sendAndConfirm|createUmi|setup|main" src/examples package.json src -S 2>/dev/null | head -300Repository: metaplex-foundation/developer-hub
Length of output: 14894
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== target generated file =="
cat -n src/examples/bubblegum/update-inherit-royalties/index.js | sed -n '1,120p'
echo
echo "== target native umi.ts source =="
cat -n src/examples/bubblegum/update-inherit-royalties/umi.ts | sed -n '1,220p'
echo
echo "== sibling generated/native for comparison =="
for f in src/examples/bubblegum/*/umi.ts; do
if [ -n "$f" ]; then
echo "--- $f ---"
cat -n "$f" | sed -n '1,140p'
fi
done
echo
echo "== identity/signing imports and usages in bubblegum natives =="
rg -n "keypairIdentity|walletAdapterIdentity|keypairFrom|createUmi|fromPrivateKey|sendAndConfirm|updateMetadataV2" src/examples/bubblegum -SRepository: metaplex-foundation/developer-hub
Length of output: 27693
Configure the signer before sending the update.
sendAndConfirm(umi) needs an authority signer, but both the native umi.ts source and generated index.js only create Umi without keypairIdentity(...), walletAdapterIdentity(...), or another signer. Update src/examples/bubblegum/update-inherit-royalties/umi.ts and regenerate the file.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/examples/bubblegum/update-inherit-royalties/index.js` around lines 12 -
13, Configure an authority signer in the Umi setup used by the
update-inherit-royalties example before calling sendAndConfirm in main. Update
the createUmi chain in umi.ts to apply the project’s established
keypairIdentity, walletAdapterIdentity, or equivalent signer configuration, then
regenerate the corresponding index.js output so both sources use the same signer
setup.
| faqs: | ||
| - q: Why does royalty.basis_points_raw show 65535? | ||
| a: That is the on-chain inherit sentinel used for leaf hashing. royalty.basis_points already holds the collection rate for display. | ||
| - q: Why is creators_raw empty on an inherited cNFT? | ||
| a: Leaf creators must be empty when SFBP is inherited. Use creators for collection royalty payees. | ||
| - q: Do I need to change anything for non-inherited cNFTs? | ||
| a: No. When inheritance is not used, the _raw fields and sfbp_inherited are omitted and the main royalty and creators fields behave as before. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the required FAQ and Notes sections.
The frontmatter declares faqs, but the page has no ## FAQ section. The page also has no ## Notes section for compatibility caveats. Add both sections, or remove faqs if the page should not expose FAQ content.
Also applies to: 157-165
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/en/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`
around lines 24 - 30, Add the missing “## FAQ” section in the page body and
render the existing frontmatter faqs entries there, then add a “## Notes”
section containing the relevant compatibility caveats. Keep the declared faqs
frontmatter and ensure both sections are included in the document structure.
Source: Coding guidelines
| ## Field map | ||
|
|
||
| | Use case | Fields | | ||
| |----------|--------| | ||
| | Display rate / royalty UI | `royalty.basis_points`, `royalty.percent` | | ||
| | Display payees / payout splits | `creators` | | ||
| | Hashing, merkle proofs, write instructions | `royalty.basis_points_raw`, `creators_raw` | | ||
| | Detect inherit mode | `royalty.sfbp_inherited` (or `basis_points_raw === 65535`) | | ||
|
|
||
| ### Example DAS response (inherited) | ||
|
|
||
| ```json |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add BLUF sentences before non-prose content.
## Field map, ### Example DAS response, ## Detection and display helpers, and ## What not to do begin with a table, code block, or list. Add one direct declarative sentence under each heading before that content.
Also applies to: 90-92, 147-151
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/en/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`
around lines 52 - 63, Add a concise, direct declarative introductory sentence
immediately below each affected heading—“Field map,” “Example DAS response,”
“Detection and display helpers,” and “What not to do”—before its table, code
block, or list. Keep the existing content unchanged and apply the same BLUF
treatment to the additional referenced sections.
Source: Coding guidelines
| // Instruction arg name for existing leaf metadata (V2 collection is a pubkey). | ||
| currentMetadata: { | ||
| name: assetWithProof.metadata.name, | ||
| symbol: assetWithProof.metadata.symbol, | ||
| uri: assetWithProof.metadata.uri, | ||
| sellerFeeBasisPoints: assetWithProof.metadata.sellerFeeBasisPoints, | ||
| primarySaleHappened: assetWithProof.metadata.primarySaleHappened, | ||
| isMutable: assetWithProof.metadata.isMutable, | ||
| tokenStandard: assetWithProof.metadata.tokenStandard, | ||
| creators: assetWithProof.metadata.creators, | ||
| collection: some(publicKey('YourCollectionAddressHere')), | ||
| }, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
for file in \
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md \
src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md \
src/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.md \
src/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.md
do
rg -n -C 4 'currentMetadata|assetWithProof\.metadata\.collection|collection:.*YourCollectionAddressHere' "$file"
doneRepository: metaplex-foundation/developer-hub
Length of output: 15255
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate bubblegum source references and docs around updateMetadataV2/currentMetadata"
rg -n "updateMetadataV2|currentMetadata|collection:.*Some\\(|collection.*assetWithProof|unwrapOption\\(assetWithProof\\.metadata\\.collection\\)" -S . \
-g '!node_modules' -g '!dist' -g '!build' | head -n 220
echo
echo "Bubblegum package references in docs"
rg -n "mpl-bubblegum|metadata collection|currentMetadata|coreCollection" src/pages/en/smart-contracts src/pages/ja/smart-contracts -g '*.md' | head -n 160Repository: metaplex-foundation/developer-hub
Length of output: 50389
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Check MPL Bubblegum docs site metadata.current.collection/assetWithProof.metadata.collection/type hints"
python3 - <<'PY'
from urllib.request import urlopen
from urllib.error import HTTPError
import re
urls = [
"https://mpl-bubblegum.typedoc.metaplex.com/classes/mpl_bubblegum.Metadata",
"https://mpl-bubblegum.typedoc.metaplex.com/modules/mpl_bubblegum.html#UpdateArgsArgs",
]
for url in urls:
print(f"\n--- {url}")
try:
data = urlopen(url, timeout=20).read().decode("utf-8", errors="replace")
for pat in [
"current",
"currentMetadata",
"collection",
"assetWithProof.metadata",
"UpdateMetadataV2",
]:
idx = data.find(pat)
if idx != -1:
start = max(0, idx - 500)
end = min(len(data), idx + 1200)
snippet = data[start:end].replace("\n", " ")
print(f"FOUND [{pat}]")
print(snippet)
except Exception as exc:
print(f"ERROR: {type(exc).__name__}: {exc}")
PY
echo
echo "Check package manager presence and lockfile versions for mpl-bubblegum without installing"
if [ -f package.json ]; then jq '.dependencies["`@metaplex-foundation/mpl-bubblegum`"], .devDependencies["`@metaplex-foundation/mpl-bubblegum`"]' package.json; fi
if [ -f pnpm-lock.yaml ]; then rg -n "`@metaplex-foundation/mpl-bubblegum`|version:" pnpm-lock.yaml | head -n 40; fi
if [ -f yarn.lock ]; then rg -n '"`@metaplex-foundation/mpl-bubblegum`"|version:"' yarn.lock | head -n 40; fiRepository: metaplex-foundation/developer-hub
Length of output: 3155
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate Umi option helpers"
rg -n "function (some|none)|const (some|none)|export (function|const) .*some|MetadataArgsV2Args|type MetadataArgs|option:" -S . \
-g '!node_modules' -g '!dist' -g '!build' | head -n 180
echo
echo "Read candidate Umi helper definitions and bubblegum V2 metadata type definitions in repo"
for file in \
$(rg -l "function some|const some|export .*option|MetadataArgsV2Args|type MetadataArgs" -S . --glob '!node_modules' --glob '!dist' --glob '!build' | head -n 20)
do
echo "--- $file"
rg -n -C 3 "function some|const some|export .*option|MetadataArgsV2Args|type MetadataArgs|MetadataArgsV2|collection.*Option|current.*Metadata|currentMetadata" "$file" || true
done
echo
echo "Compare generated example update-metadata V2 imports/args"
sed -n '1,70p' src/examples/bubblegum/update-inherit-royalties/umi.tsRepository: metaplex-foundation/developer-hub
Length of output: 34183
Use assetWithProof.metadata.collection for currentMetadata.collection.
These updateMetadataV2 examples pass the leaf’s collection, but the currentMetadata objects replace it with a placeholder collection, so the documented examples will not match asset metadata for any leaf that has a different collection. Use assetWithProof.metadata.collection for collection. For update-cnfts.md, also set both currentMetadata.collection and coreCollection from the same leaf/provided collection so the example is internally consistent.
📍 Affects 4 files
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md#L286-L297(this comment)src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md#L96-L106src/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.md#L287-L298src/pages/ja/smart-contracts/bubblegum-v2/update-cnfts.md#L96-L106
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md` around lines 286
- 297, Replace the placeholder collection in the currentMetadata objects with
assetWithProof.metadata.collection. Apply this in
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md (lines 286-297),
src/pages/ja/smart-contracts/bubblegum-v2/sdk/javascript.md (lines 287-298), and
both update-cnfts.md files at lines 96-106; in the English and Japanese
update-cnfts.md examples, also set coreCollection from the same leaf/provided
collection so both fields remain consistent.
| 对于从 MPL-Core 集合继承卖家费用的 Bubblegum V2 cNFT,集合解析后的展示值位于 `royalty.basis_points` / `creators`,叶子值位于 `royalty.basis_points_raw` / `creators_raw`(同时 `royalty.sfbp_inherited: true`)。请参阅[读取继承版税](/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties)。 | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Qualify DAS resolved fields with the collection-resolution condition.
These summaries state that DAS exposes the collection royalty on main fields for every inherited cNFT. DAS exposes collection-resolved values only when it can resolve the collection. Otherwise, royalty.basis_points may fall back while royalty.basis_points_raw remains 65535.
src/pages/zh/dev-tools/das-api/methods/get-asset.md#L10-L11: add the resolution condition.src/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.md#L59-L59: add the fallback behavior.src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L39-L39: qualify the DAS field mapping.src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L167-L177: qualify display-field usage.src/pages/zh/smart-contracts/bubblegum-v2/fetch-cnfts.md#L211-L211: qualify the Notes guidance.src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md#L300-L300: qualify the DAS mapping.src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L33-L33: qualify the FAQ statement.src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L150-L152: qualify the minting guidance.
📍 Affects 6 files
src/pages/zh/dev-tools/das-api/methods/get-asset.md#L10-L11(this comment)src/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.md#L59-L59src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L39-L39src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L167-L177src/pages/zh/smart-contracts/bubblegum-v2/fetch-cnfts.md#L211-L211src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md#L300-L300src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L33-L33src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L150-L152
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/zh/dev-tools/das-api/methods/get-asset.md` around lines 10 - 11,
Qualify all DAS inherited-royalty documentation with the requirement that
collection resolution succeeds: update
src/pages/zh/dev-tools/das-api/methods/get-asset.md lines 10-11,
src/pages/ja/smart-contracts/bubblegum-v2/hashed-nft-data.md line 59,
src/pages/zh/smart-contracts/bubblegum-v2/faq.md lines 39 and 167-177,
src/pages/zh/smart-contracts/bubblegum-v2/fetch-cnfts.md line 211,
src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md line 300, and
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md lines 33 and 150-152.
State that collection-resolved values populate the display fields only when the
collection is resolved; otherwise describe the fallback where
royalty.basis_points may fall back while royalty.basis_points_raw remains 65535,
and adjust each field-mapping, display, notes, FAQ, and minting statement
accordingly.
| 铸造到 MPL-Core 集合时,可以在叶子上存储**哨兵** seller fee basis points 值(`65535`,导出为 `SELLER_FEE_BASIS_POINTS_INHERIT` / `0xffff`),而不是将集合的版税百分比复制到每个 cNFT。DAS 将集合解析后的费率放在 `royalty.basis_points` / `creators` 上供展示,并将叶子哨兵放在 `royalty.basis_points_raw` / `creators_raw` 上(同时 `royalty.sfbp_inherited: true`),而链上叶子为哈希保留哨兵值。 | ||
|
|
||
| **读取** DAS 响应的客户端(钱包、市场、索引器与应用)应遵循[读取继承版税](/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties)。 |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add explicit anchors for localized fragment targets.
The changed links use English fragments, but the Chinese target headings do not define those anchors. Add {% #inheriting-royalties-from-the-collection %} to the minting heading and {% #inherited-royalties %} to the update heading.
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L150-L152: add the anchor to the heading at Line 148.src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md#L159-L159: add the anchor to the heading at Line 157.src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L186-L186: keep the minting and update links after adding the anchors.src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md#L160-L161: keep both localized fragments resolvable.src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md#L300-L300: keep the minting fragment resolvable.src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L167-L167: keep the update fragment resolvable.
As per coding guidelines, localized internal-link targets require explicit anchors. Based on learnings, CJK slugification does not create stable English fragments.
📍 Affects 5 files
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L150-L152(this comment)src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md#L159-L159src/pages/zh/smart-contracts/bubblegum-v2/faq.md#L186-L186src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md#L160-L161src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md#L300-L300src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md#L167-L167
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md` around lines 150 -
152, Localized English fragment links need explicit anchors: add {%
`#inheriting-royalties-from-the-collection` %} to the minting heading in
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md:150-152 and {%
`#inherited-royalties` %} to the update heading in
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md:159-159. In
src/pages/zh/smart-contracts/bubblegum-v2/faq.md:186-186,
src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md:160-161,
src/pages/zh/smart-contracts/bubblegum-v2/hashed-nft-data.md:300-300, and
src/pages/zh/smart-contracts/bubblegum-v2/mint-cnfts.md:167-167, keep the
existing minting and update links unchanged so both fragments resolve to these
anchors.
Sources: Coding guidelines, Learnings
| faqs: | ||
| - q: 为什么 royalty.basis_points_raw 显示为 65535? | ||
| a: 那是链上用于叶子哈希的继承哨兵值。royalty.basis_points 已包含用于展示的集合费率。 | ||
| - q: 为什么继承版税的 cNFT 上 creators_raw 为空? | ||
| a: 当 SFBP 被继承时,叶子上的 creators 必须为空。请使用 creators 获取集合版税收款方。 | ||
| - q: 对于非继承版税的 cNFT,我需要改什么吗? | ||
| a: 不需要。未使用继承时,_raw 字段与 sfbp_inherited 会被省略,主要的 royalty 与 creators 字段行为与之前相同。 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Match faqs frontmatter to a visible FAQ section.
This page declares faqs, but it has no ## FAQ section. Add a localized FAQ section for these entries, or remove the faqs field.
As per coding guidelines, faqs is allowed only when an FAQ section is present.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md`
around lines 24 - 30, The page’s faqs frontmatter must match the document
structure: add a localized ## FAQ section containing the declared questions and
answers, or remove the faqs field if no visible FAQ section is desired. Keep the
selected content consistent with the existing Chinese FAQ entries.
Source: Coding guidelines
| a: 不需要。未使用继承时,_raw 字段与 sfbp_inherited 会被省略,主要的 royalty 与 creators 字段行为与之前相同。 | ||
| --- | ||
|
|
||
| ## 摘要 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the required ## Summary heading.
This page uses ## 摘要. The documentation contract requires a ## Summary block on localized pages.
As per coding guidelines, documentation pages must include a ## Summary block.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/zh/smart-contracts/bubblegum-v2/reading-inherited-royalties.md` at
line 33, Rename the localized page’s `## 摘要` heading to the required `##
Summary` heading, preserving the existing summary content and structure.
Source: Coding guidelines
| currentMetadata: { | ||
| name: assetWithProof.metadata.name, | ||
| symbol: assetWithProof.metadata.symbol, | ||
| uri: assetWithProof.metadata.uri, | ||
| sellerFeeBasisPoints: assetWithProof.metadata.sellerFeeBasisPoints, | ||
| primarySaleHappened: assetWithProof.metadata.primarySaleHappened, | ||
| isMutable: assetWithProof.metadata.isMutable, | ||
| tokenStandard: assetWithProof.metadata.tokenStandard, | ||
| creators: assetWithProof.metadata.creators, | ||
| collection: some(publicKey('22222222222222222222222222222222')), | ||
| }, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate files"
fd -a 'update-cnfts\.md|javascript\.md' . | sed 's#^\./##'
echo
echo "Relevant snippets"
for f in \
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md \
src/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.md
do
if [ -f "$f" ]; then
echo "--- $f"
line=$(rg -n "currentMetadata|collection:" "$f" | head -3 | cut -d: -f1 | head -1 || true)
echo "currentMetadata/Collection occurrences: $(rg -n 'currentMetadata|collection:' "$f" || true)"
if [ -n "${line:-}" ]; then
start=$((line-12)); [ "$start" -lt 1 ] && start=1
end=$((line+20))
sed -n "${start},${end}p" "$f" | cat -n
fi
fi
done
echo
echo "English source references"
for f in \
src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md \
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md
do
if [ -f "$f" ]; then
echo "--- $f"
line=$(rg -n "currentMetadata|collection:" "$f" | head -3 | cut -d: -f1 | head -1 || true)
if [ -n "${line:-}" ]; then
start=$((line-12)); [ "$start" -lt 1 ] && start=1
end=$((line+20))
sed -n "${start},${end}p" "$f" | cat -n
fi
fi
done
echo
echo "Search for Bubblegum updateMetadataV2 currentMetadata examples"
rg -n "updateMetadataV2|currentMetadata|MetadataArgsV2|collection:" src/pages -g '*.md' | head -200Repository: metaplex-foundation/developer-hub
Length of output: 35924
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "English snippets with exact currentMetadata blocks"
for f in \
src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md \
src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md
do
echo "--- $f"
awk '/currentMetadata: \{/,/},$/{print NR":"$0}' "$f"
done
echo
echo "Bubblegum V2 relevant documentation"
sed -n '240,530p' src/pages/en/smart-contracts/bubblegum-v2/hashed-nft-data.md | cat -n
sed -n '510,530p' src/pages/en/smart-contracts/bubblegum-v2/collections.md | cat -n
sed -n '480,525p' src/pages/en/smart-contracts/bubblegum-v2/sdk/javascript.md | cat -n
sed -n '88,115p' src/pages/en/smart-contracts/bubblegum-v2/update-cnfts.md | cat -n
echo
echo "Check whether placeholder public keys happen to be repeated elsewhere"
rg -n "22222222222222222222222222222222|YourCollectionAddressHere|currentMetadata:" src/pages/en/smart-contracts/bubblegum-v2 src/pages/zh/smart-contracts/bubblegum-v2 | sed 's#^\./##'Repository: metaplex-foundation/developer-hub
Length of output: 10206
🌐 Web query:
Metaplex mpl-bubblegum updateMetadataV2 currentMetadata collection field AssetWithProof metadata collection
💡 Result:
The updateMetadataV2 instruction in the mpl-bubblegum program is used to modify the metadata of a compressed NFT (cNFT) [1]. When using this instruction, the currentMetadata field must be provided, typically retrieved via getAssetWithProof, to allow the program to verify the current leaf before applying updates [1]. Regarding the collection field within the metadata and its interaction with AssetWithProof: 1. Collection Handling: In Bubblegum V2, the collection field in MetadataArgsV2 is an Option<Pubkey> [2][3][4]. Unlike Bubblegum V1, which used Token Metadata collections with a "verified" boolean, V2 collections are always considered verified [2][5]. 2. Providing Metadata: When calling updateMetadataV2, you must pass the currentMetadata (which includes the collection field) derived from your assetWithProof object [1]. 3. Collection Authority: If the cNFT belongs to a collection, the update authority for the cNFT is the collection authority [1]. In such cases, you must provide the coreCollection argument to the updateMetadataV2 function [1]. If the cNFT does not belong to a collection, the update authority is the tree authority, and the coreCollection argument should be omitted [1]. When updating, you should use some() for fields you wish to modify and omit those that should remain unchanged [1]. Ensure that the currentMetadata provided matches the existing state of the asset on-chain to ensure the cryptographic proof remains valid [1][6].
Citations:
- 1: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/update-cnfts
- 2: https://docs.rs/mpl-bubblegum/latest/mpl_bubblegum/types/struct.MetadataArgsV2.html
- 3: https://mpl-bubblegum.typedoc.metaplex.com/types/MetadataArgsV2.html
- 4: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/hashed-nft-data
- 5: https://www.metaplex.com/docs/smart-contracts/bubblegum-v2/collections
- 6: https://docs.rs/mpl-bubblegum/latest/mpl_bubblegum/instructions/struct.UpdateMetadataV2InstructionArgs.html
Preserve the leaf collection in currentMetadata.
currentMetadata mirrors the existing leaf state. Replace the placeholder with the leaf collection value using the same option shape as the nearby Bubblegum V2 examples.
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md#L96-L106src/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.md#L287-L298
📍 Affects 2 files
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md#L96-L106(this comment)src/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.md#L287-L298
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md` around lines 96 -
106, Replace the placeholder collection in currentMetadata within
src/pages/zh/smart-contracts/bubblegum-v2/update-cnfts.md lines 96-106 with the
existing leaf collection value, preserving the option shape used by nearby
Bubblegum V2 examples. Apply the same correction in
src/pages/zh/smart-contracts/bubblegum-v2/sdk/javascript.md lines 287-298; both
sites must continue mirroring the leaf’s current metadata.
https://developer-hub-git-feat-bguminheritsfbp-metaplex-foundation.vercel.app/docs/smart-contracts/bubblegum-v2#whats-new-in-bubblegum-v2
https://developer-hub-git-feat-bguminheritsfbp-metaplex-foundation.vercel.app/docs/smart-contracts/bubblegum-v2/mint-cnfts#inheriting-royalties-from-the-collection
etc.