mintSoulBoundToken(______________) - OpenDive/AptosKit GitHub Wiki
mintSoulBoundToken(_:_:_:_:_:_:_:)
Mints a new soul-bound token within a specified collection using the given parameters.
public func mintSoulBoundToken(
_ creator: Account,
_ collection: String,
_ description: String,
_ name: String,
_ uri: String,
_ properties: PropertyMap,
_ soulBoundTo: AccountAddress
)
A soul-bound token is a token that is irrevocably tied to a specific account (soul-bound to an account).
The function constructs a transaction payload with several parameters defining the properties of the new soul-bound token, which are then encoded into TransactionArguments using appropriate Serializers based on their types. An additional TransactionArgument is created for the account to which the token will be soul-bound.
An EntryFunction object is then created with the given token module address, the function name to be invoked ("mint_soul_bound"),
and the constructed transaction arguments. This entry function is used to create a TransactionPayload which is then signed
and submitted to the client.
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 soul-bound token.
- collection: The collection in which the new token will be minted.
- description: The description of the new soul-bound token.
- name: The name of the new soul-bound token.
- uri: The URI for the new soul-bound token.
- properties: A PropertyMap object representing the additional properties of the new soul-bound token.
- soulBoundTo: The address of the account to which the token will be soul-bound.
Throws
This function throws an error if converting the properties to a tuple, creating the EntryFunction, signing the transaction, or submitting the transaction fails.
Returns
A String that represents the response from the transaction submission to mint a new soul-bound token.