Package Exports
- @piratecrewfun/pirate-sdk
- @piratecrewfun/pirate-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 (@piratecrewfun/pirate-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Pirate SDK
A TypeScript SDK for interacting with the PiratesCrewFun API..
Installation
npm install @piratecrewfun/pirate-sdkQuick Start
import { PirateSDK } from "@piratecrewfun/pirate-sdk";
const sdk = new PirateSDK({
secretKey: "your-base58-private-key",
network: "mainnet-beta",
rpcUrl: "https://api.mainnet-beta.solana.com",
apiKey: "your-api-key"
});
const result = await sdk.createToken({
name: "My Token",
symbol: "MTK",
image: "/path/to/logo.png",
description: "An awesome token",
buyAmount: 0.1, // Initial buy in SOL
website: "https://mytoken.com",
x: "https://twitter.com/mytoken",
telegram: "https://t.me/mytoken"
});
console.log("Pool created:", result.poolAddress);
console.log("Token mint:", result.mintAddress);Complete Example
import { PirateSDK } from "@piratecrewfun/pirate-sdk";
import { PoolParams } from "@piratecrewfun/pirate-sdk/types";
import path from "path";
async function createMyToken() {
const sdk = new PirateSDK({
secretKey: "your-base58-private-key-here",
network: "mainnet-beta",
rpcUrl: "https://api.mainnet-beta.solana.com",
apiKey: "your-api-key"
});
const poolParams: PoolParams = {
name: "CREW",
symbol: "CREW",
image: "https://piratecrew.fun/images/alt-twitter-profile.avif"
description: "Community token for the crew",
buyAmount: 0.1, // Buy 0.1 SOL worth initially
website: "https://crew.com",
x: "https://twitter.com/crew",
telegram: "https://t.me/crew",
kolHandle: "crew_kol"
};
try {
const result = await sdk.createToken(poolParams);
console.log("Token created successfully!");
console.log("Pool address:", result.poolAddress);
console.log("Token mint:", result.mintAddress);
console.log("Transaction signatures:", result.signatures);
return result;
} catch (error) {
console.error("Failed to create token:", error);
throw error;
}
}
createMyToken();Pool Parameters
interface PoolParams {
name: string; // Token name (1-20 chars)
symbol: string; // Token symbol (1-10 chars, uppercase)
image: string; // Path to logo image file
description?: string; // Token description (optional)
buyAmount?: number; // Initial buy amount in SOL (default: 0)
website?: string; // Website URL (optional)
x?: string; // Twitter/X URL (optional)
telegram?: string; // Telegram URL (optional)
kolHandle?: string; // KOL handle (optional)
}Network Support
- Mainnet Beta: Production Solana network
Requirements
- Node.js 16+
- A Solana wallet with sufficient SOL for:
- Transaction fees (~0.05 SOL)
- Initial token purchase (if
buyAmount > 0) - Platform fees
Security Notes
- Never commit private keys to version control
- Use environment variables for sensitive data
- Test on devnet before mainnet deployment
Support
For issues and questions:
- GitHub Issues: Updating Soon
- Documentation: Updating Soon
License
MIT License - see LICENSE file for details.