Coder Social home page Coder Social logo

lan-phan / waltid-nftkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from walt-id/waltid-nftkit

0.0 0.0 0.0 19.82 MB

Use digital assets like non-fungible tokens (NFTs)

License: Apache License 2.0

JavaScript 38.58% Java 6.39% Kotlin 14.87% TypeScript 39.67% Dockerfile 0.07% Solidity 0.42%

waltid-nftkit's Introduction

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

waltid-nftkit's People

Contributors

ahmedsmiai avatar aminbenmansour avatar github-actions[bot] avatar khemiriwalid avatar mikeplotean avatar philpotisk avatar severinstampler avatar superbatata avatar taminobaumann avatar waltkb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.