Update Account Permission

Updates the permissions of an account, setting multi-signature permissions with a set signature threshold. Useful for creating a safely shared account.

Payload Parameters

RequiredParameterTypeDescription

permissions

Array of AccPermission Object

Set sender account's name

AccPermission structure

RequiredParameterTypeDescription

type

number

0: Owner,

1: User

permissionName

string

Permission identifier

threshold

number

Minimum sign amount to permit transaction

operations

string

signers

AccKey object array

Defines the weight of the accounts' votes

AccKey structure

RequiredParameterTypeDescription

address

string

Target address

weight

number

Target address' vote weight

Operations

The operations property defines which operations the account should be able to do.

The value that this property receives is a hexadecimal string, where each bit represents a contract.

Ex:

"01af" is the hexadecimal to 000110101111.

The 1's represent the contracts it should be able to do (following this table)

This account will be able to do contracts of type 0, 1, 2, 3, 5, 7, 8 (Transfer, Create Asset, Create Validator, Config Validator, Unfreeze, Undelegate, Withdraw).

Relevant Link: binary to hex calculator

After getting the hexadecimal string, you need to invert the byte order, for proper processing in the blockchain. you can use either of the following JS code to do so:

utils.parseAccountPermissionBinaryOperations("000110101111")

utils.reverseHexBytes("01af")

Both return the same "af01" which is the correct value for said operations.

Last updated