tokens/nft-operations: add the native (Solana Native) flavor to complete the anchor/native/pinocchio trio

未关闭
#754 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #769 来自 @sehaha —— 已关闭,未合并

评估

难度
5/5
预计耗时
一周以上
新手友好度
48/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust, typescript

调研方向

Read AGENTS.md and CONTRIBUTING.md, then compare the existing tokens/nft-operations/anchor/ and pinocchio/ flavors with the native examples named in the proposal. The work spans a Rust program crate and LiteSVM tests using @solana/kit; done means adding tokens/nft-operations/native/ with hand-built token-metadata instructions and the required build-and-test script. The issue is newly opened and has no comments or linked pull requests, but the proposed implementation is substantial.

由索引模型根据 Issue 内容生成。

描述

Proposal

tokens/nft-operations currently ships two flavors: anchor/ and pinocchio/. The native/ flavor is missing, which breaks the repo's stated pattern of "one per framework flavor" for token examples (cf. tokens/create-token, tokens/transfer-tokens, tokens/pda-mint-authority, tokens/escrow, which all ship the full trio).

This issue proposes adding tokens/nft-operations/native/ — a Solana Native (plain cargo build-sbf) implementation of the same NFT operations the Anchor flavor teaches, so learners can compare the three frameworks on the same example.

Why this example

  • Framework-completion PRs have direct precedent: the Solana Foundation's recent program-examples bounty rounds paid for exactly this kind of flavor coverage (Account Data, PDA-Rent-Payer, Create Token, Transfer Tokens, Token Swap, etc.).
  • native/ is the middle ground learners use to understand what Anchor generates for them — it is the most instructive diff of the trio for Metaplex-heavy examples, since the native flavor hand-builds token-metadata instructions (per AGENTS.md, no mpl crate dependency, mpl_util.rs pattern).

What I will deliver (on approval — happy to be assigned)

  • tokens/nft-operations/native/ following the repo layout: program/ crate (root workspace member), package.json with the mandatory build-and-test script, LiteSVM-based tests via @solana/kit + litesvm 1.x (mocha + tsx, FailedTransactionMetadata assertions, svm.expireBlockhash() on resend).
  • Hand-built Metaplex token-metadata instructions in Rust (no mpl crate), mirroring the pinocchio flavor's approach where applicable.
  • No toolchain bumps, no lockfile hoisting, no shared JS helpers — AGENTS.md and CONTRIBUTING.md followed.
  • A separate branch + PR referencing Fixes #<this issue> once approved.

If the maintainers would rather see a different flavor gap filled first (e.g. tokens/token-swap native), I'm happy to redirect — it's open for me to pick up.

主要语言
TypeScript
星标
1.4k
派生
557
平均合并
1 小时 25 分钟
30 天内合并 PR
4

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

solana-foundation/program-examples 的其他 Issue

查看 solana-foundation/program-examples 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。