Skip to content

burnToken(____)

MarcoDotIO edited this page Jun 26, 2023 · 2 revisions

burnToken(_:_:)

Burns a token from the given creator's account.

public func burnToken(
        _ creator: Account,
        _ token: AccountAddress
    )

The function constructs a transaction payload with the EntryFunction named "burn", a TypeTag for the type of the token, and a TransactionArgument for the token to be burnt.

The constructed payload is then signed and submitted for execution on the client. 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 from which the token will be burnt.
  • token: The address of the token to be burnt.

Throws

This function throws an error if creating the EntryFunction, signing the transaction, or submitting the transaction fails.

Returns

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

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally