Coder Social home page Coder Social logo

helius-compression-examples's Introduction

NFT Compression Examples

This repository provides examples on how to mint and interact with compressed NFTs. The examples are based Metaplex's examples but are updated to be compatible with the latest API spec and Helius RPCs.

Scripts

E2E

Runs a compression example end-to-end. Mints a collection NFT and a compressed NFT for that collection, and then transfers it to another wallet. The transfer calls the Helius compression indexer to verify ownership before transferring and to include the current proof in the transfer txn.

Note: This example does not use a canopy for simplicity. A canopy is an on-chain cache that reduces the size of the proofs required. This is useful for production apps that require large trees.

npm run e2e

BURN

Provided the assetId of a compressd nft owned by the wallet passed in SECRET_KEY, this script proceeds to burn it.

npm run burn -- --assetId=<base58 encoded assetId>

REDEEM

Provided the assetId of a compressd nft owned by the wallet passed in SECRET_KEY, this script redeems an NFT (remove from tree and store in a voucher PDA).

npm run redeem -- --assetId=<base58 encoded assetId>

CANCEL REDEEM

Provided the assetId of a compressd nft owned by the wallet passed in SECRET_KEY, this script cancels the redemption of an NFT (Put the NFT back into the Merkle tree).

npm run cancel-redeem -- --assetId=<base58 encoded assetId>

helius-compression-examples's People

Contributors

nicolaspennie avatar solhosty avatar japif 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.