Freemint App (NextJS)

This example app, built with Next.js, makes it super easy to integrate Glittr’s features into your projects if you’re using the Next.js tech stack. It’s designed to keep things smooth and simple, so you won’t have to deal with any complicated setup. It also comes with wallet integration, giving you the flexibility to choose whichever wallet you prefer to use.

Live Preview

Visit our website to preview the Freemint app and explore its features.

How to Build

You can also build your own app using our example. Here are the steps :

  1. Navigate to the repository, then proceed to the freemint-nextjs folder

    cd glittr-examples/glittr-free-mint-nextjs

  2. Create a .env file and add the following environment variables

    # testnet
    NEXT_PUBLIC_NETWORK=testnet
    NEXT_PUBLIC_GLITTR_API=https://testnet-core-api.glittr.fi
    NEXT_PUBLIC_WALLET_API=https://testnet-electrum.glittr.fi
    NEXT_PUBLIC_EXPLORER=https://testnet-explorer.glittr.fi
  3. Install dependencies

    npm install
    # or
    yarn install
  4. Start the development server

    npm run dev
    # or
    yarn dev
  5. Open your browser and navigate to

    http://localhost:3000/

Usage

This is the first page of the Freemint app. There's a button to connect your wallet, and below that, there's a minting section and a list of assets that has been minted to your address.

First thing to do, click the "Connect" button and choose the wallet you want to interact with in the app.

Once you're connected, you'll see a form to deploy your own Freemint contract. On the side, you'll find your minted assets displayed at your address. You can also choose to mint from the pre-deployed contract on the bottom of the page.

When you hit the "Mint" button, you'll be taken to your wallet confirmation screen to sign the transaction. If it goes through, you'll see a confirmation letting you know your transaction is successfully on the Bitcoin blockchain.

Once the transaction is confirmed, the assets will appear on the right side of the page.

Last updated