Javascript SDK

A Token Mill javascript SDK is available on Githubarrow-up-right. It provides easy to use functions for token creation (requires an API key) and swaps.

Create token

const sdk = new TokenMillSDK("https://api.mainnet-beta.solana.com");
const apiKey = process.env.API_KEY ?? "";
sdk.setApiKey(apiKey);
sdk.initializeAnchorWallet();

const tokenMetadata: TokenMetadata = {
  name: "My Token",
  symbol: "MYTK",
  imagePath: "Path to the icon image, PNG or JPEG, 5Mo maximum",
  description: "My custom description",
  socials: {
      discord: "https://discord.gg/mytoken",
      telegram: "https://t.me/mytoken",
      twitter: "https://twitter.com/mytoken",
      website: "https://mytoken.com",
    },
};

await sdk.createMarket(tokenMetadata);

Optional swap parameters can be provided for the initial buy

Swap

Last updated