@metaplex-foundation/mpl-token-metadata-kit
v0.0.2
Published
JavaScript client for Token Metadata using @solana/kit
Keywords
Readme
JS Kit Client
This is the TypeScript client for mpl-token-metadata using @solana/kit (Solana web3.js 2.0), generated with Codama.
Generated Code
The client code is auto-generated by Codama in src/generated/. Do not edit these files manually - they will be regenerated when running pnpm generate:clients from the repository root.
Testing
Test files have been created in test/ but require additional infrastructure to run:
Test Structure
Tests follow the same structure as clients/js/test/ but use the new API:
const mint = await generateKeypair();
const createInstruction = createV1({
mint: mint.address,
name: 'My NFT',
uri: 'https://example.com/my-nft.json',
sellerFeeBasisPoints: 550,
tokenStandard: TokenStandard.Fungible,
});Running Tests
Tests connect to a local Solana validator and skip gracefully if it's not running:
# Install dependencies
pnpm install
# Build the project (will show TypeScript errors but still produces output)
pnpm build
# Run tests (will skip if validator not running)
pnpm testRunning Tests with Validator
To actually execute transactions:
# From repository root, build the program first
pnpm programs:build
# Start the local validator (in a separate terminal)
pnpm validator
# From clients/js-kit, run tests
pnpm testTests will:
- ✅ Connect to local validator at
http://127.0.0.1:8899 - ✅ Generate keypairs using @solana/keys
- ✅ Airdrop SOL for test transactions
- ✅ Generate instructions using Codama client
- ✅ Skip transaction sending (not yet implemented)
- ℹ️ Show helpful messages if validator isn't running
Development
To regenerate this client:
# From repository root
pnpm generate:clientsThis will run configs/codama.cjs which generates code in clients/js-kit/src/generated/.
