Creating a minting bot

The SDK can be used on the server side, enabling use cases such as running a minting bot

Example Scripts

Two ready-to-run bots live in the repository:

Each script demonstrates the most direct path to minting—preparePurchase followed by product.purchase()—so you don’t have to orchestrate transaction steps manually.

Running an example

  1. From the repository root:

    pnpm install
    pnpm build
  2. Inside the example directory:

    pnpm install
    cp .env.example .env
    pnpm start
  3. Fill in the environment variables before running.

Basic Example

Best Practices

  • Type Validation: Use isBlindMintProduct or isEditionProduct for proper TypeScript typings

  • Status Checks: Always run getStatus before attempting purchases

  • Error Handling: Properly handle ClientSDKError codes

  • Gas Management: Monitor gas prices and set appropriate limits

  • Retry Logic: Implement retry mechanisms for transient failures

  • Security: Never commit private keys, use environment variables

Environment Configuration

Resources

Last updated