sealed class PublicKeyTreeA tree data structure that enables the representation of composite public keys.
In the simplest case it may just contain a single node encapsulating a PublicKey – a Leaf.
For more complex scenarios, such as
Using these constructs we can express e.g. 1 of N (OR) or N of N (AND) signature requirements. By nesting we can
create multi-level requirements such as
| Builder |
class BuilderA helper class for building a PublicKeyTree.Node. |
| Leaf |
class Leaf : PublicKeyTreeThe leaf node of the public key tree – a wrapper around a PublicKey primitive |
| Node |
class Node : PublicKeyTreeRepresents a node in the PublicKeyTree. It maintains a list of child nodes – sub-trees, and associated weights carried by child node signatures. |
| keys |
abstract val keys: Set<PublicKey>Returns all PublicKeys contained within the tree leaves |
| singleKey |
val singleKey: PublicKeyReturns the enclosed PublicKey for a PublicKeyTree with a single node |
| containsAny |
fun containsAny(otherKeys: Iterable<PublicKey>): <ERROR CLASS>Checks whether any of the given keys matches a leaf on the tree |
| isFulfilledBy |
abstract fun isFulfilledBy(keys: Iterable<PublicKey>): BooleanChecks whether keys match a sufficient amount of leaf nodes fun isFulfilledBy(key: PublicKey): <ERROR CLASS> |
| toBase58String |
fun toBase58String(): String |
| parseFromBase58 |
fun parseFromBase58(encoded: String): <ERROR CLASS> |
| Leaf |
class Leaf : PublicKeyTreeThe leaf node of the public key tree – a wrapper around a PublicKey primitive |
| Node |
class Node : PublicKeyTreeRepresents a node in the PublicKeyTree. It maintains a list of child nodes – sub-trees, and associated weights carried by child node signatures. |