Skip to main content
Glama

Crossmint HR Airdrop MCP

by monostate
tokenCreation.ts1.76 kB
// Token creation utility based on deploy_token.ts from solana-agent-kit import { Connection, Keypair, PublicKey } from '@solana/web3.js'; import { z } from 'zod'; export interface TokenCreationResult { success: boolean; mintAddress?: string; error?: string; } export interface TokenCreationParams { name: string; symbol: string; supply: number; decimals: number; connection: Connection; payer: Keypair; } export const TokenParamsSchema = z.object({ name: z.string().min(1, "Token name must not be empty"), symbol: z.string().min(1, "Token symbol must not be empty"), supply: z.number().positive("Supply must be positive"), decimals: z.number().min(0).max(9).default(9), }); /** * Create a new token on Solana * * This is a simulation of token creation since we don't have direct access to the * deploy_token.ts functionality from solana-agent-kit */ export async function createToken(params: TokenCreationParams): Promise<TokenCreationResult> { try { // Validate parameters TokenParamsSchema.parse({ name: params.name, symbol: params.symbol, supply: params.supply, decimals: params.decimals }); // In a real implementation, we would call the Metaplex SDK to create the token // Since this is a simulation, we'll generate a random mint address // Simulate token creation delay await new Promise(resolve => setTimeout(resolve, 2000)); // Generate a pseudo-random mint address const mintAddress = `TokenMint${Math.random().toString(36).substring(2, 10)}`; return { success: true, mintAddress, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/monostate/Employees-Airdrop-Rewards-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server