Skip to content

Add kit plugin functionality - #182

Merged
MarkSackerberg merged 1 commit into
mainfrom
feat/kitPlugin
Mar 20, 2026
Merged

Add kit plugin functionality#182
MarkSackerberg merged 1 commit into
mainfrom
feat/kitPlugin

Conversation

@MarkSackerberg

@MarkSackerberg MarkSackerberg commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Updating Codama to 1.5.1 and regenerate clients/js-kit to add Kit plugin functionality. This allows something like

  import { createEmptyClient, createSolanaRpc, createSolanaRpcSubscriptions } from '@solana/kit';                                                                                                                                                                               
  import {                                                                                                                                                                                                                                                                      
    mplTokenMetadataProgram,                                                                                                                                                                                                                                                    
    TokenStandard,                                                                                                                                                                                                                                                              
    createArgs,                                             
  } from '@metaplex-foundation/mpl-token-metadata-kit';
  import { generateKeyPairSigner } from '@solana/signers';                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                
  // Build client with plugin(s)                                                                                                                                                                                                                                                
  const client = createEmptyClient()                                                                                                                                                                                                                                            
    .use(mplTokenMetadataProgram());                                                                                                                                                                                                                                            
    // .use(anotherProgram())
                                                                                                                                                                                                                                                                                
  // --- Create an NFT instruction ---                                                                                                                                                                                                                                          
  const authority = await generateKeyPairSigner();                                                                                                                                                                                                                              
  const mint = await generateKeyPairSigner();                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                
  const ix = await client.mplTokenMetadata.instructions.create({                                                                                                                                                                                                                
    mint,                                                                                                                                                                                                                                                                       
    authority,                                                                                                                                                                                                                                                                  
    payer: authority,                                       
    createArgs: createArgs('V1', {
      name: 'My NFT',                                                                                                                                                                                                                                                           
      uri: 'https://example.com/nft.json',
      sellerFeeBasisPoints: 500,                                                                                                                                                                                                                                                
      creators: null,                                       
      tokenStandard: TokenStandard.NonFungible,                                                                                                                                                                                                                                 
    }),                                                                                                                                                                                                                                                                         
  });
  // ix is a plain instruction: { accounts, data, programAddress }                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                
  // --- Fetch metadata from chain ---                                                                                                                                                                                                                                          
  const rpc = createSolanaRpc('https://api.mainnet-beta.solana.com');                                                                                                                                                                                                           
  const metadata = await client.mplTokenMetadata.accounts.metadata.fetch(rpc, metadataAddress);                                                                                                                                                                                 
                                                                                                                                                                                                                                                                                
  // --- Derive PDAs ---                                                                                                                                                                                                                                                        
  const [metadataPda] = await client.mplTokenMetadata.pdas.metadata({ mint: mintAddress });                                                                                                                                                                                     

@vercel

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mpl-token-metadata-js-docs Ready Ready Preview, Comment Mar 20, 2026 1:54pm
mpl-token-metadata-js-kit-docs Ready Ready Preview, Comment Mar 20, 2026 1:54pm

Request Review

@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown

Walkthrough

Updated clients/js-kit/package.json to consolidate Solana dependencies by removing individual @solana/* packages and replacing them with @solana-program-client-core. Version bumps include @solana-program/token to 0.12.0 and @solana/kit to 6.5.0.

Changes

Cohort / File(s) Summary
Dependency Consolidation
clients/js-kit/package.json
Removed multiple individual @solana/* runtime dependencies (accounts, addresses, codecs, instructions, rpc, transactions, etc.) and replaced with @solana-program-client-core (^6.1.0). Updated @solana/kit from ^5.0.0 to ^6.5.0 and @solana-program/token from ^0.9.0 to ^0.12.0 in devDependencies.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • Kit SDK #179: Directly modifies the same clients/js-kit/package.json dependency declarations.

Suggested reviewers

  • tonyboylehub
  • blockiosaurus
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Add kit plugin functionality' is vague and does not clearly reflect the actual changes, which involve updating dependencies and regenerating the js-kit client based on a Codama version update. Consider a more specific title such as 'Update js-kit dependencies and regenerate with Codama 1.5.1' to better reflect the actual changes made to package.json and the client generation process.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the purpose of updating Codama and adding Kit plugin functionality, with a detailed code example demonstrating the new usage patterns.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/kitPlugin
📝 Coding Plan
  • Generate coding plan for human review comments

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.

@MarkSackerberg
MarkSackerberg merged commit 320b982 into main Mar 20, 2026
13 checks passed
@MarkSackerberg
MarkSackerberg deleted the feat/kitPlugin branch March 20, 2026 14:33
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.

2 participants