solana-nft-minter

module
v0.0.0-...-b1dc30f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2022 License: MIT

README

Solana NFT Minter

olegfomenko Go Report Card

Description

Library for minting NFTs from specified image on receiver or admin account. NFT data (image and metadata json) can be stored on the IPFS Infura service.

Using Example

Explore Test Module file

Infura part

inf := infura.NewDefaultInfura("https://ipfs.infura.io:5001", "project-id", "project-secret")

// Saving image in Infura
cid, err := inf.AddInfuraImage("./test_image.jpeg")

imageUrl := inf.GetLinkIPFS(cid)

metadata := solana.Metadata{
// Set fields here
}

// Saving metadata in Infura
cid, err = inf.AddInfuraJSON(metadata)

Solana part

var admin types.Account{}

sol := solana.Solana{client.NewClient("https://api.devnet.solana.com")}

// Also you can use MintTokenUntilSuccess
hash, err := sol.MintToken(metadata, solana.MintConfig{
    Receiver:            admin.PublicKey,
    Admin:               admin,
    Creators:            []types.Account{admin},
    Metadata:            inf.GetLinkIPFS(cid),
    PrimarySaleHappened: true,
})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL