CNFT (cnft v0.1.0)

View Source

CNFT is a module for handling transactions related to creating, minting, and transferring NFTs on the Solana blockchain.

This module uses Rustler to interface with native Rust code for performance-critical operations.

Summary

Functions

Creates a tree transaction and logs the result.

Creates a tree transaction.

Transfers an NFT to a new owner and logs the result.

Functions

create(rpc_client, payer)

Creates a tree transaction and logs the result.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • payer: The account that will pay for the transaction.

create_tree_transaction(rpc_client, payer)

Creates a tree transaction.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • payer: The account that will pay for the transaction.

Returns

  • A transaction data structure.

mint(rpc_client, tree, owner, payer, name, symbol, uri, nounce)

Mints a new NFT and logs the result.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • tree: The tree structure where the NFT will be minted.
  • owner: The account that will own the minted NFT.
  • payer: The account that will pay for the transaction.
  • name: The name of the NFT.
  • symbol: The symbol of the NFT.
  • uri: The URI pointing to the NFT metadata.
  • nounce: A unique identifier for the minting process.

mint_transaction(rpc_client, tree, owner, payer, name, symbol, uri, nounce)

Mints a new NFT.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • tree: The tree structure where the NFT will be minted.
  • owner: The account that will own the minted NFT.
  • payer: The account that will pay for the transaction.
  • name: The name of the NFT.
  • symbol: The symbol of the NFT.
  • uri: The URI pointing to the NFT metadata.
  • nounce: A unique identifier for the minting process.

Returns

  • A transaction data structure.

transfer(rpc_client, asset, owner, payer, receiver)

Transfers an NFT to a new owner and logs the result.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • asset: The NFT asset to be transferred.
  • owner: The current owner of the NFT.
  • payer: The account that will pay for the transaction.
  • receiver: The account that will receive the NFT.

transfer_transaction(rpc_client, asset, owner, payer, receiver)

Transfers an NFT to a new owner.

Parameters

  • rpc_client: The RPC client to interact with the Solana blockchain.
  • asset: The NFT asset to be transferred.
  • owner: The current owner of the NFT.
  • payer: The account that will pay for the transaction.
  • receiver: The account that will receive the NFT.

Returns

  • A transaction data structure.