Here's the updated README file with the additional information:
This guide demonstrates how to create Solana Program Library (SPL) tokens and Non-Fungible Tokens (NFTs) on the SOON testnet using the Metaplex Foundation's UMI framework and MPL Token Metadata program.
- Node.js (v14 or higher)
- npm or yarn package manager
- Basic understanding of Solana, SPL tokens, and NFTs
- Pinata account and API keys (from Pinata.cloud)
Install the required dependencies:
pnpm i
- Clone this repository or create a new directory for your project
- Make sure you have a funded wallet on SOON testnet
- Obtain your Pinata API keys from the Pinata.cloud website and add them to a
.env
file in the project directory:PINATA_JWT=your_pinata_jwt_here PINATA_GATEWAY_TOKEN=your_pinata_gateway_token_here
The code uses the following main components:
- UMI instance connected to SOON testnet
- Payer keypair for signing transactions
- Mint signer for the new token and NFT
umi
: UMI instance connected to SOON testnet RPC endpointpayerSecretKey
: Your wallet's secret key (Keep this secure!)mint
: Newly generated token mint addressNFTsigner
: Signer for creating the new NFT
The SPL token is created with the following parameters:
- Name: "BONK"
- Decimals: 7
- Seller Fee: 5.5%
- URI: Points to metadata stored on Pinata
The NFT is created with the following parameters:
- Name: "My NFT"
- Description: "This is an NFT on SOON"
- Image: Hosted on Pinata
- External URL: "https://x.com/soon-svm"
- Attributes: "trait1" and "trait2"
- Replace the
payerSecretKey
with your own wallet's secret key - Modify the token and NFT parameters in the
main()
function as needed:- SPL Token:
name
,uri
,sellerFeeBasisPoints
,decimals
- NFT:
name
,description
,image
,external_url
,attributes
- SPL Token:
- Run the script:
pnpm nft
The script will output:
- Payer's SOL balance
- Payer's public key
- New token's mint address
- New NFT's mint address
- Transaction hashes
- Never commit your secret key to version control
- Store sensitive information in environment variables
- Ensure your wallet has sufficient SOL for transaction fees
The code is configured for SOON testnet. To use different networks:
Feel free to submit issues and enhancement requests!