BubblegumNifs (bubblegum_nifs v0.1.2) View Source

Elixir interface for Metaplex Bubblegum compressed NFTs

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function

create_tree(rpc_url, payer_keypair, max_depth, max_buffer_size, public)

View Source

Specs

create_tree(
  rpc_url(),
  keypair(),
  non_neg_integer(),
  non_neg_integer(),
  boolean()
) ::
  {:ok, map()} | {:error, BubblegumNifs.Error.t()}

Initializes a compressed NFT tree

Decode a base58 string to binary

Link to this function

get_rent_for_account_size(client, size)

View Source

Specs

get_rent_for_account_size(BubblegumNifs.SolanaRpc.client(), non_neg_integer()) ::
  {:ok, non_neg_integer()} | {:error, any()}

Gets the minimum rent for a specific account size

Parameters

  • client - The RPC client
  • size - Account size in bytes

Returns

  • {:ok, rent} - Rent amount in lamports if successful
  • {:error, any()} - Error if the request fails
Link to this function

mint_compressed_nft(rpc_url, payer_keypair, tree_pubkey, recipient_pubkey, metadata)

View Source

Specs

mint_compressed_nft(
  rpc_url(),
  keypair(),
  pubkey(),
  pubkey(),
  metadata()
) :: {:ok, String.t()} | {:error, any()}

Mints a new compressed NFT

Link to this function

mint_to_collection(rpc_url, payer_keypair, tree_pubkey, recipient_pubkey, collection_mint, collection_authority_keypair, metadata)

View Source

Specs

mint_to_collection(
  rpc_url(),
  keypair(),
  pubkey(),
  pubkey(),
  pubkey(),
  keypair(),
  metadata()
) :: {:ok, String.t()} | {:error, any()}

Mints a new compressed NFT to a collection

Link to this function

transfer_compressed_nft(rpc_url, owner_keypair, new_owner_pubkey, asset_id)

View Source

Specs

transfer_compressed_nft(
  rpc_url(),
  keypair(),
  pubkey(),
  asset_id()
) :: {:ok, String.t()} | {:error, any()}

Transfers a compressed NFT to a new owner

This function fetches the asset proof and details from the DAS API, then constructs and sends the transfer transaction.