TypeScript Methods for ERC-1155 Token Account Status
Blockchain App Builder automatically generates methods that you can use to manage account status for tokens that use the extended ERC-1155 standard.
You can use the following methods to put token user accounts in the active, suspended, or deleted states.
When an account is suspended, the account user cannot complete any write operations, which include minting, burning, and transferring tokens. Additionally, other users cannot transfer tokens to a suspended account. A suspended account can still complete read operations.
An account with a non-zero token balance cannot be deleted. You must transfer or burn all tokens in an account before you can delete the account. After an account is in the deleted state, the account state cannot be changed back to active or suspended.
Automatically Generated Account Status Methods
-
getAccountStatus - This method gets the current status of the token account. This
method can be called by the
Token Adminof the chaincode or by the token account owner. -
getAccountStatusHistory - This method gets the history of the account status. This method
can be called by the
Token Adminof the chaincode or by the token account owner. -
activateAccount - This method activates a token account. This method can be called
only by a
Token Adminof the chaincode. Deleted accounts cannot be activated. For any accounts created prior to the account status functionality being available, you must call this method to set the account status asactive. -
suspendAccount - This method suspends a token account. This method can be called
only by a
Token Adminof the chaincode. After an account is suspended, you cannot complete any operations that update the account. A deleted account cannot be suspended. -
deleteAccount - This method deletes a token account. This method can be called
only by a
Token Adminof the chaincode. After an account is deleted, you cannot complete any operations that update the account. The deleted account is in a final state and cannot be changed to any other state. To delete an account, the account balance must be zero.
-
getAccountStatus - This method gets the current status of the token account. This method can be called by the
Token Adminof the chaincode or by the token account owner. -
getAccountStatusHistory - This method gets the history of the account status. This method can be called by the
Token Adminof the chaincode or by the token account owner. -
activateAccount - This method activates a token account. This method can be called only by a
Token Adminof the chaincode. Deleted accounts cannot be activated. For any accounts created prior to the account status functionality being available, you must call this method to set the account status asactive. -
suspendAccount - This method suspends a token account. This method can be called only by a
Token Adminof the chaincode. After an account is suspended, you cannot complete any operations that update the account. A deleted account cannot be suspended. -
deleteAccount - This method deletes a token account. This method can be called only by a
Token Adminof the chaincode. After an account is deleted, you cannot complete any operations that update the account. The deleted account is in a final state and cannot be changed to any other state. To delete an account, the account balance must be zero.
Account Status SDK Methods
-
getAccountStatus - This method gets the current status of the token account.
-
getAccountStatusHistory - This method gets the history of the account status.
-
activateAccount - This method activates a token account. For any accounts created prior to the account status functionality being available, you must call this method to set the account status as
active. -
suspendAccount - This method suspends a token account.
-
deleteAccount - This method deletes a token account.