Skip to content

addTokenProperty(______)

MarcoDotIO edited this page Jun 26, 2023 · 2 revisions

addTokenProperty(_:_:_:)

Adds a property to a token from the given creator's account.

public func addTokenProperty(
        _ creator: Account,
        _ token: AccountAddress,
        _ prop: Property
    )

The function constructs a transaction payload with the EntryFunction named "add_property", a TypeTag for the type of the token, and TransactionArguments for the token to which the property will be added and the property itself.

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 which owns the token and will add the property to it.
  • token: The address of the token to which the property will be added.
  • prop: The property that will be added to the token.

Throws

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

Returns

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

Types
Protocols
Global Variables
Global Functions
Extensions
Clone this wiki locally