A full-featured Solana Metaplex Candymachine client-side library in Typescript

Overview

Candymachine Client SDK

A full-featured Solana Metaplex Candymachine client-side library in Typescript

Disclaimer: The SDK is currently a pre-alpha version

About

The Candymachine Client SDK offers all functionalities of the former Metaplex Candy Machine CLI but on a standalone pure Typescript client-side library that can run on any browser.

Features

  • Create a Candy Machine V2 with multiple and configurable settings:
    • Captcha enabled/disabled.
    • Mutability on the NFTs.
    • Price, number of NFTs.
    • Authority.
    • NFTs hosted on Arweave.
    • Time and date to start the minting.
  • Update any Candy Machine V2 in which you are the authority and have the cache file.
  • Explore any Candy Machine V2, view the minted NFTs, remaining NFTs to mint...
  • Mint a NFT from the Candy Machine V2.
  • Available on Solana's Mainnet and Devnet networks.
  • Fully compatible with React and NextJS.

Built with

  • Typescript
  • Metaplex
  • Anchor from Serum
  • Solana web3.js

Installation

$ npm i @boxfish-studio/candymachine-client-sdk
$ yarn add @boxfish-studio/candymachine-client-sdk
$ pnpm add @boxfish-studio/candymachine-client-sdk

How to use

Upload your first Candy Machine

  1. Import uploadV2, loadCandyProgramV2, StorageType, verifyAssets functions and enums:
import { uploadV2, loadCandyProgramV2, StorageType, verifyAssets } from '@boxfish-studio/candymachine-client-sdk'

async function createCandyMachineV2() {
        let candyMachine: string = ''
        const config: ICandyMachineConfig = {
            price: 1,
            number: 200,
            gatekeeper: null,
            solTreasuryAccount: ******************, // where the NFTs initial sale SOL will go to
            splTokenAccount: null,
            splToken: null,
            goLiveDate: "21 Jul 2023 16:00:00 GMT",
            endSettings: null,
            whitelistMintSettings: null,
            hiddenSettings: null,
            storage: StorageType.Arweave,
            ipfsInfuraProjectId: null,
            ipfsInfuraSecret: null,
            nftStorageKey: null,
            awsS3Bucket: null,
            noRetainAuthority: false,
            noMutable: false,
            arweaveJwk: null,
            batchSize: null,
            pinataGateway: null,
            pinataJwt: null,
            uuid: null,
        }
        // files being all the assets uploaded to the page: [0.json, 0.png, 1.json, 1.png....]
        const { supportedFiles, elemCount } = verifyAssets(files, config.storage, config.number)

        const provider = new AnchorProvider(connection, anchorWallet, {
            preflightCommitment: 'recent',
        })

        const anchorProgram = await loadCandyProgramV2(provider)

        const {
            storage,
            nftStorageKey,
            ipfsInfuraProjectId,
            number,
            ipfsInfuraSecret,
            pinataJwt,
            pinataGateway,
            arweaveJwk,
            awsS3Bucket,
            retainAuthority,
            mutable,
            batchSize,
            price,
            splToken,
            treasuryWallet,
            gatekeeper,
            endSettings,
            hiddenSettings,
            whitelistMintSettings,
            goLiveDate,
            uuid,
        } = await getCandyMachineV2Config(publicKey, config, anchorProgram)

        try {
            const _candyMachine = await uploadV2({
                files: supportedFiles,
                cacheName: 'example',
                env: "devnet",
                totalNFTs: elemCount,
                gatekeeper,
                storage,
                retainAuthority,
                mutable,
                batchSize,
                price,
                treasuryWallet,
                anchorProgram,
                walletKeyPair: anchorWallet, // from react solana wallet package
                endSettings,
                hiddenSettings,
                whitelistMintSettings,
                goLiveDate,
                rateLimit: null,
            })

            if (typeof _candyMachine === 'string') candyMachine = _candyMachine
            console.log("Candy machine v2 successfully created!")
        } catch (err) {
            console.error("Error during candy machine v2 upload.")
        }

    }

Acknowledgements

This SDK has been built thanks to Metaplex's Candy Machine CLI.

License

Apache 2.0 © Boxfish Studio

Comments
  • [Task]: add CI to autodeploy to npmjs

    [Task]: add CI to autodeploy to npmjs

    merging to main will attempt a deploy, it will only succeed if the package version number has increased compared to the previous version

    package name: @boxfish-studio/candymachine-client-sdk first released version: 0.0.1 inspiration: https://github.com/boxfish-studio/sveltekit-cookie-mananger

    opened by begonaalvarezd 1
  • chore: rename ci action

    chore: rename ci action

    Changes

    • Rename ci action

    Checks

    • [x] Have you catchup your branch with the latest state in base?
    • [x] Have you lint your code locally prior to submission?
    • [x] Have you reviewed your proposed changes and removed debris?
    • [x] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
  • chore: bump version

    chore: bump version

    Changes

    • Bump package version

    Checks

    • [x] Have you catchup your branch with the latest state in base?
    • [x] Have you lint your code locally prior to submission?
    • [x] Have you reviewed your proposed changes and removed debris?
    • [x] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
  • chore: fix readme

    chore: fix readme

    Changes

    • Fix readme typo and wording

    Checks

    • [x] Have you catchup your branch with the latest state in base?
    • [x] Have you lint your code locally prior to submission?
    • [x] Have you reviewed your proposed changes and removed debris?
    • [x] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
  • chore: fix ci release

    chore: fix ci release

    Changes

    • Ignore git checks in pnpm publishing

    Checks

    • [ ] Have you catchup your branch with the latest state in base?
    • [ ] Have you lint your code locally prior to submission?
    • [ ] Have you reviewed your proposed changes and removed debris?
    • [ ] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
  • chore: bump version to 0.0.5

    chore: bump version to 0.0.5

    Changes

    • Bump version

    Checks

    • [ ] Have you catchup your branch with the latest state in base?
    • [ ] Have you lint your code locally prior to submission?
    • [ ] Have you reviewed your proposed changes and removed debris?
    • [ ] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
  • chore: readme and release

    chore: readme and release

    Changes

    • Improves slightly the readme
    • Changes release workflow to only run on new tags

    Checks

    • [x] Have you catchup your branch with the latest state in base?
    • [x] Have you lint your code locally prior to submission?
    • [x] Have you reviewed your proposed changes and removed debris?
    • [x] Have you successfully ran due tests with your changes?
    opened by agus-xyz 0
Releases(v0.1.0)
  • v0.1.0(Aug 28, 2022)

    What's Changed

    • chore: fix readme by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/23
    • chore: bump version by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/24
    • chore: rename ci action by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/25

    Full Changelog: https://github.com/boxfish-studio/candymachine-client-sdk/compare/v0.0.5...v0.1.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Aug 19, 2022)

    What's Changed

    • chore: init package by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/1
    • ci: add github actions workflow to autodeploy to npmjs by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/7
    • ci: fix workflow to work with pnpm by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/9
    • feat: add pnpm setup action to ci by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/10
    • fix: remove react deps from sdk by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/11
    • feat: add initial readme by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/6
    • docs: add documentation to sdk functions by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/2
    • refactor: remove lib folder by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/12
    • ci: add .npmignore and update types dist input by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/14
    • chore: bump version to 0.0.2 by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/13
    • fix: add cache to exports by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/15
    • chore: bump version to 0.0.3 by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/16
    • feat: add absolute path and ignore tsconfig by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/17
    • chore: bump version to 0.0.4 by @aspnxdd in https://github.com/boxfish-studio/candymachine-client-sdk/pull/18
    • chore: miscellaneous by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/19
    • chore: readme and release by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/20
    • chore: bump version to 0.0.5 by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/21
    • chore: fix ci release by @agus-xyz in https://github.com/boxfish-studio/candymachine-client-sdk/pull/22

    New Contributors

    • @aspnxdd made their first contribution in https://github.com/boxfish-studio/candymachine-client-sdk/pull/1
    • @agus-xyz made their first contribution in https://github.com/boxfish-studio/candymachine-client-sdk/pull/19

    Full Changelog: https://github.com/boxfish-studio/candymachine-client-sdk/commits/v0.0.5

    Source code(tar.gz)
    Source code(zip)
Owner
Boxfish Studio
Amazing Digital Innovation - High quality solutions for emerging industries and technologies
Boxfish Studio
This repo contains instructions on how to create your NFT in Solana(using Metaplex and Candy Machine) and mint it using your custom front-end Dapp

Solana-NFT minting Dapp Create your own NFT's on Solana, and mint them from your custom front-end Dapp. Tools used Metaplex -> Metaplex is the NFT sta

Udit Sankhadasariya 12 Nov 2, 2022
NFT vending machine proof of concept built on Solana Pay, Metaplex, Phantom Mobile and Next.js.

Solana NFT Vending Machine This is a proof of concept of an NFT vending machine built using Solana Pay, Metaplex, Phantom Mobile, and Next.js. This wa

Matt Rosenzweig 55 Dec 15, 2022
Postgres.js - The Fastest full featured PostgreSQL client for Node.js and Deno

?? Fastest full-featured node & deno client ?? ES6 Tagged Template Strings at the core ??‍♀️ Simple surface API ??️ Dynamic query support ?? Chat and

Rasmus Porsager 4.3k Jan 1, 2023
🛠 Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

?? Solana Web3 Tools - A set of tools to improve the user experience on Web3 Solana Frontends.

Holaplex 30 May 21, 2022
solana-base-app is a base level, including most of the common features and wallet connectivity, try using `npx solana-base-app react my-app`

solana-base-app solana-base-app is for Solana beginners to get them up and running fast. To start run : run npx solana-base-app react my-app change th

UjjwalGupta49 33 Dec 27, 2022
Fast and minimal JS server-side writer and client-side manager.

unihead Fast and minimal JS <head> server-side writer and client-side manager. Nearly every SSR framework out there relies on server-side components t

Jonas Galvez 24 Sep 4, 2022
Easy server-side and client-side validation for FormData, URLSearchParams and JSON data in your Fresh app 🍋

Fresh Validation ??     Easily validate FormData, URLSearchParams and JSON data in your Fresh app server-side or client-side! Validation Fresh Validat

Steven Yung 20 Dec 23, 2022
This SDK helps developers get started with the on-chain tools provided by Metaplex.

Metaplex JavaScript SDK ⛔️ DO NOT USE IN PRODUCTION, THIS SDK IS IN VERY EARLY ALPHA STAGES! This SDK helps developers get started with the on-chain t

Metaplex Foundation 263 Dec 27, 2022
Wonka JS is the easiest way to mint Metaplex's Candy Machine NFTs with APIs.

Wonka JS Wonka JS is the easiest way to mint from Candy Machine and fetch NFTs through JS APIs. You can see an end to end example in Next.js demo proj

Wonka Labs 71 Nov 3, 2022
Full featured JavaScript image & video gallery. No dependencies

lightgallery.js Full featured JavaScript lightbox gallery. No dependencies. Important notice lightgallery.js has been merged with lightGallery. That m

Sachin Neravath 5.2k Dec 30, 2022
A Full-Featured Modern Dashboard Template for Discord Bots

D-Dash: Discord Bot Dashboard A Full-Featured Dashboard Template for Discord Bots You can modify config/config.js to edit configuration without touchi

MONEY 33 Jan 8, 2023
Triumph Tech’s Magnus Editor is a full-featured remote editor for Rock RMS.

Magnus Visual Studio Code Editor for Rock RMS Triumph Tech’s Magnus Editor is a full-featured remote editor for Rock RMS. Rock RMS is an open source R

Triumph Tech 8 Nov 23, 2022
A lightweight, fully-featured, modular, typescript-compatible javascript library for Paymongo.

paymongo.js A lightweight, fully-featured, modular, typescript-compatible javascript library for PayMongo. Installation npm install paymongo.js # or y

Prince Carlo Juguilon 15 Nov 23, 2022
Make drag-and-drop easier using DropPoint. Drag content without having to open side-by-side windows

Make drag-and-drop easier using DropPoint! DropPoint helps you drag content without having to open side-by-side windows Works on Windows, Linux and Ma

Sudev Suresh Sreedevi 391 Dec 29, 2022
This is an application that entered the market with a mobile application in real life. We wrote the backend side with node.js and the mobile side with flutter.

HAUSE TAXI API Get Started Must be installed on your computer Git Node Firebase Database Config You should read this easy documentation Firebase-Fires

Muhammet Çokyaman 4 Nov 4, 2021
This plugin allows side-by-side notetaking with videos. Annotate your notes with timestamps to directly control the video and remember where each note comes from.

Obsidian Timestamp Notes Use Case Hello Obsidian users! Like all of you, I love using Obsidian for taking notes. My usual workflow is a video in my br

null 74 Jan 2, 2023
This Plugin is For Logseq. If you're using wide monitors, you can place journals, linked references, and journal queries side by side.

Logseq Column-Layout Plugin Journals, linked references, and journal queries can be placed side by side if the minimum screen width is "1850px" or mor

YU 14 Dec 14, 2022
NFT stacking frontend completion using web3 on solana for client Nelson project.

NFT stacking frontend completion using web3 on solana for client Nelson project.

Kapollo 12 Dec 16, 2022
JavaScript Client for the UXD Solana Program.

JavaScript Client for the UXD Solana Program Install npm install --save @uxd-protocol/uxd-client Usage About UXD on Solana Mainnet-Beta UXD Program:

UXDProtocol 16 Jan 3, 2023