Skip to content

mintToken(____________)

MarcoDotIO edited this page Jun 26, 2023 · 2 revisions

mintToken(_:_:_:_:_:_:)

Mints a new token within a specified collection using the given parameters.

public func mintToken(
        _ creator: Account,
        _ collection: String,
        _ description: String,
        _ name: String,
        _ uri: String,
        _ properties: PropertyMap
    )

The function generates a transaction payload using the mintTokenPayload method with the provided parameters. It then submits this payload to a client to mint a new token. The function operates asynchronously and returns the result of the transaction submission.

Note: This function is marked with the async keyword, which means it returns a future that represents a result that is produced at some point in the future. When you call a function that’s marked with the async keyword, you need to use the await keyword.

Parameters

  • creator: The account to be used to mint the token.
  • 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 creating the payload, signing the transaction, or submitting the transaction fails.

Returns

A String that represents the response from the transaction submission to mint a new token.

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally