BubblegumNifs (bubblegum_nifs v0.1.2) View Source
Elixir interface for Metaplex Bubblegum compressed NFTs
Link to this section Summary
Functions
Initializes a compressed NFT tree
Decode a base58 string to binary
Gets the minimum rent for a specific account size
Mints a new compressed NFT
Mints a new compressed NFT to a collection
Transfers a compressed NFT to a new owner
Link to this section Types
Specs
asset_id() :: String.t()
Specs
hash() :: binary()
Specs
index() :: non_neg_integer()
Specs
keypair() :: BubblegumNifs.KeypairInfo.t()
Specs
metadata() :: BubblegumNifs.MetadataArgs.t()
Specs
nonce() :: non_neg_integer()
Specs
pubkey() :: String.t()
Specs
rpc_url() :: String.t()
Link to this section Functions
Link to this function
create_tree(rpc_url, payer_keypair, max_depth, max_buffer_size, public)
View SourceSpecs
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
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 clientsize
- 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 SourceSpecs
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 SourceSpecs
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 SourceSpecs
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.