Class: PermissionWallet

module:kadence/permission~ PermissionWallet

Manages owned solutions as files in a directory

new PermissionWallet(directory, privateKey)

Parameters:
Name Type Description
directory string Path to wallet directory
privateKey buffer Owner private key
Source:

Members


balance

Properties:
Name Type Description
balance number Total number of solutions stored
Source:

solutions

Properties:
Name Type Description
solutions Array.<string> List of solution results
Source:

Methods


get(key)

Returns the PermissionSolution by it's result key
Parameters:
Name Type Description
key buffer | string solution key to retrieve
Source:
Returns:
Type
PermissionSolution

put(solution)

Creates or overwrites a solution
Parameters:
Name Type Description
solution PermissionSolution Solution to insert
Source:

transfer(solutionKey, publicKey)

Transfers ownership of a solution to a new public key and removes the solution from the wallet
Parameters:
Name Type Description
solutionKey string | buffer solution key to transfer
publicKey buffer New owner key of the solution
Source:
Returns:
Type
PermissionSolution

validate()

Scans all solutions in the wallet and moves invalid ones to a directory named ".invalid"
Source:
Returns:
Type
Promise