Package Exports
- @bagsfm/bags-sdk
- @bagsfm/bags-sdk/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bagsfm/bags-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@bagsfm/bags-sdk
A TypeScript SDK for interacting with the Bags Public API - Solana token launch and management platform.
Installation
npm install @bagsfm/bags-sdkUsage
import { BagsSDK } from '@bagsfm/bags-sdk';
import { Connection, PublicKey } from '@solana/web3.js';
// Initialize the SDK
const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=your-helius-api-key'); // Or any other RPC provider
const sdk = new BagsSDK('your-bags-api-key', connection, 'processed');
// Use the SDK services
const tokenMint = new PublicKey('your-token-mint-address');
const creators = await sdk.state.getTokenCreators(tokenMint);
console.log('Token creators:', creators);API Reference
BagsSDK
The main SDK class that provides access to all services:
bagsApiClient: HTTP API client for Bags servicestokenLaunch: Token launch management servicestate: State management serviceconfig: Configuration servicefee: Fee management service
Constructor
new BagsSDK(apiKey: string, connection: Connection, commitment?: Commitment)Parameters:
apiKey: Your Bags API keyconnection: Solana web3.js Connection instancecommitment: (optional) Transaction commitment level (default: 'processed')
Requirements
- Node.js >= 18.0.0
- A Bags API key (get one at https://dev.bags.fm)
- A Solana RPC provider (we recommend Helius - they offer a free tier)
Development
# Install dependencies
npm install
# Build the project
npm run build
# Watch mode for development
npm run dev
# Clean build artifacts
npm run cleanLicense
MIT
Support
For issues and questions, please visit our GitHub Issues.