Skip to content

Commit

Permalink
chore: group together permissions functions in the ERC725 class
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed May 17, 2024
1 parent 08e72d6 commit 07e123a
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,50 +506,6 @@ export class ERC725 {
);
}

/**
* Encode permissions into a hexadecimal string as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissions The permissions you want to specify to be included or excluded. Any ommitted permissions will default to false.
* @returns {*} The permissions encoded as a hexadecimal string as defined by the LSP6 Standard.
*/
static encodePermissions(permissions: Permissions): string {
return encodePermissions(permissions);
}

/**
* Encode permissions into a hexadecimal string as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissions The permissions you want to specify to be included or excluded. Any ommitted permissions will default to false.
* @returns {*} The permissions encoded as a hexadecimal string as defined by the LSP6 Standard.
*/
encodePermissions(permissions: Permissions): string {
return encodePermissions(permissions);
}

/**
* Decodes permissions from hexadecimal as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissionHex The permission hexadecimal value to be decoded.
* @returns Object specifying whether default LSP6 permissions are included in provided hexademical string.
*/
static decodePermissions(permissionHex: string) {
return decodePermissions(permissionHex);
}

/**
* Decodes permissions from hexadecimal as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissionHex The permission hexadecimal value to be decoded.
* @returns Object specifying whether default LSP6 permissions are included in provided hexademical string.
*/
decodePermissions(permissionHex: string) {
return decodePermissions(permissionHex);
}

/**
* Hashes a key name for use on an ERC725Y contract according to LSP2 ERC725Y JSONSchema standard.
*
Expand Down Expand Up @@ -638,6 +594,53 @@ export class ERC725 {
return supportsInterface(interfaceIdOrName, options);
}

// Permissions related functions
// -----------------------------

/**
* Encode permissions into a hexadecimal string as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissions The permissions you want to specify to be included or excluded. Any ommitted permissions will default to false.
* @returns {*} The permissions encoded as a hexadecimal string as defined by the LSP6 Standard.
*/
static encodePermissions(permissions: Permissions): string {
return encodePermissions(permissions);
}

/**
* Encode permissions into a hexadecimal string as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissions The permissions you want to specify to be included or excluded. Any ommitted permissions will default to false.
* @returns {*} The permissions encoded as a hexadecimal string as defined by the LSP6 Standard.
*/
encodePermissions(permissions: Permissions): string {
return encodePermissions(permissions);
}

/**
* Decodes permissions from hexadecimal as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissionHex The permission hexadecimal value to be decoded.
* @returns Object specifying whether default LSP6 permissions are included in provided hexademical string.
*/
static decodePermissions(permissionHex: string) {
return decodePermissions(permissionHex);
}

/**
* Decodes permissions from hexadecimal as defined by the LSP6 KeyManager Standard.
*
* @link https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-6-KeyManager.md LSP6 KeyManager Standard.
* @param permissionHex The permission hexadecimal value to be decoded.
* @returns Object specifying whether default LSP6 permissions are included in provided hexademical string.
*/
decodePermissions(permissionHex: string) {
return decodePermissions(permissionHex);
}

/**
* Check if the required permissions are included in the granted permissions as defined by the LSP6 KeyManager Standard.
*
Expand Down

0 comments on commit 07e123a

Please sign in to comment.