@rifflix/rifflix-sdk
v0.1.0
Published
This SDK allows developers to easily mint SPL tokens on the Solana blockchain with full metadata support, making it ideal for token launches, NFT infrastructure, DAOs, and Web3 apps.
Readme
Rifflix Contract SDK
This SDK allows developers to easily mint SPL tokens on the Solana blockchain with full metadata support, making it ideal for token launches, NFT infrastructure, DAOs, and Web3 apps.
🚀 Features
- Mint SPL tokens with name, symbol, and metadata URI
- Supports creation of associated token accounts
- Adds token metadata using Metaplex's Token Metadata program
- Optionally revokes mint and freeze authorities for security
- Built for Anchor-compatible environments but flexible for general use
📦 Installation & Dependencies
This SDK depends on:
@solana/web3.js@solana/spl-token@metaplex-foundation/mpl-token-metadata
You’ll also need:
- A Solana wallet (e.g. from CLI or keypair JSON)
- Funded account on devnet or mainnet
- Node.js and TypeScript environment
🛠 Usage Overview
To use this SDK:
- Initialize your connection and wallet
- Create a provider using
createAnchorProvider - Instantiate the
TokenServicewith the provider and network - Call the
createTokenmethod with token name, symbol, URI, decimals, mint amount, and optional mint/freeze authority revoke flags - Execute the transaction using the returned payload
All instructions (account creation, minting, metadata) are automatically handled inside the SDK.
🧪 Testing
A working ts-mocha test file is available under the test/ directory. It demonstrates how to mint a token with metadata on devnet and logs the resulting transaction link.
To run tests:
- Ensure your wallet is funded on devnet
- Provide RPC and wallet setup using utility functions (
getWallet,getConnection) - Execute with
ts-mocharunner
📁 Project Structure
src/: Contains theTokenServicelogictest/: Mocha test case that runs a full mint operationutils/: Helper methods for wallet and connection setup
📄 Metadata Hosting
Ensure your metadata URI points to a valid JSON file (hosted on Arweave, IPFS, or a secure HTTPS endpoint) containing token details like name, symbol, image, and description.
