Freemint App (React + Vite)

This example app is pretty much the same as the previous one, but it’s built with React and Vite instead of Next.js. It’s perfect for those who might not be as familiar with Next.js but still want to integrate Glittr’s features easily.

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 glittr-free-mint-vite-react folder

    cd glittr-examples/glittr-free-mint-vite-react

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

    # testnet
    VITE_PUBLIC_NETWORK=testnet
    VITE_PUBLIC_GLITTR_API=https://testnet-core-api.glittr.fi
    VITE_PUBLIC_WALLET_API=https://testnet-electrum.glittr.fi
    VITE_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:5173/

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