Skip to content

mintTokenPayload(__________)

MarcoDotIO edited this page Jun 26, 2023 · 2 revisions

mintTokenPayload(_:_:_:_:_:)

Constructs a TransactionPayload for minting a new token within a specified collection.

public func mintTokenPayload(
        _ collection: String,
        _ description: String,
        _ name: String,
        _ uri: String,
        _ properties: PropertyMap
    ) throws -> TransactionPayload 

The function accepts several parameters defining the properties of the new token, such as its name, description, URI, and additional properties, which are then encoded into TransactionArguments using appropriate Serializers based on their types.

An EntryFunction object is then created with the given token module address, the function name to be invoked ("mint"), and the constructed transaction arguments. Finally, a TransactionPayload is created with this entry function and returned.

Parameters

  • collection: The collection in which the new token will be minted.
  • description: The description of the new token.
  • name: The name of the new token.
  • uri: The URI for the new token.
  • properties: A PropertyMap object representing the additional properties of the new token.

Throws

This function throws an error if converting the properties to a tuple, creating the EntryFunction, or TransactionPayload fails.

Returns

A TransactionPayload object that represents the payload for the transaction to mint a new token.

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally