Skip to content

walt-id/waltid-nftkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

88bcd1d · Jul 23, 2024
Sep 11, 2023
Jul 11, 2023
Aug 11, 2023
Jul 5, 2023
Jul 22, 2024
Aug 8, 2023
Nov 14, 2022
Oct 14, 2022
Jun 1, 2022
Jun 1, 2022
Aug 8, 2023
Jun 1, 2022
Sep 1, 2022
Apr 15, 2024
Sep 28, 2022
Feb 11, 2022
Feb 11, 2022
Apr 24, 2022
Jul 8, 2023
Feb 11, 2022

Repository files navigation

NFT Kit

by walt.id

Use digital assets like non-fungible tokens (NFTs)

Join community! Follow @walt_id

Getting Started

Checkout the Official Documentation, to find out more.

What is the NFT Kit?

A Kotlin library for managing NFTs

Features

  • Deployment and Access Management of NFT smart contracts on multiple chains
  • Base functionalities like minting NFTs, managing NFT metadata and much more
  • Verification of NFT ownership and token traits
  • Smart Contract extensions to add for example token transfer control

Example

  • Deployment of ERC721 smart contract
  • Minting of a new token
  • Fetching of NFT metadata
fun main() {
    
        // Deploy new ERC721 smart contract instance on polygon network
        val deploymentOptions = DeploymentOptions(AccessControl.OWNABLE, TokenStandard.ERC721)
        val deploymentParameter = DeploymentParameter("Metaverse", "MTV",DeploymentParameter.Options(true, true))
        val result = NftService.deploySmartContractToken(Chain.POLYGON, deploymentParameter, deploymentOptions)
    
        // Mint new NFT
        val attribute1 : NftMetadata.Attributes = NftMetadata.Attributes(trait_type = "trait_type1", value = "value1")
        val attribute2 : NftMetadata.Attributes = NftMetadata.Attributes(trait_type = "trait_type2", value = "value2")
        val attributes = mutableListOf(attribute1, attribute2)
        val nftMetadata : NftMetadata = NftMetadata(name = "name", description = "description", image = "", attributes = attributes)
        val mintingParameter = MintingParameter("", "0xaf87c5Ce7a1fb6BD5aaDB6dd9C0b8EF51EF1BC31",nftMetadata)
        val mintingOptions = MintingOptions(MetadataStorageType.ON_CHAIN)
        val result = NftService.mintToken(Chain.POLYGON,"0xFd9426f82Ae1edBC6b5eC2B0Ea5416D34Ca6E9b6", mintingParameter, mintingOptions)       

        // Fetch NFT Metadata URI 
        val result = NftService.getNftMetadataUri(Chain.POLYGON, "0xFd9426f82Ae1edBC6b5eC2B0Ea5416D34Ca6E9b6", BigInteger.valueOf(26))

        // Fetch NFT Metadata
        val result = NftService.getNftMetadata(Chain.POLYGON, "0xFd9426f82Ae1edBC6b5eC2B0Ea5416D34Ca6E9b6", BigInteger.valueOf(26))
    }

Join the community

License

Licensed under the Apache License, Version 2.0