trait WalletStateAlgebra[F[_]] extends AnyRef
Defines a data API for storing and retrieving wallet interaction.
- Alphabetic
- By Inheritance
- WalletStateAlgebra
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def addEntityVks(fellowship: String, template: String, fellows: List[String]): F[Unit]
Add a new entry of fellow verification keys to the wallet interaction's cartesian indexing.
Add a new entry of fellow verification keys to the wallet interaction's cartesian indexing. Entities are at a pair of x (fellowship) and y (template) layers and thus represent a Child verification key at a participants own x/y path. The respective x and y indices of the specified fellowship and template labels must already exist.
- fellowship
A String label of the fellowship to associate the new verification keys with
- template
A String label of the template to associate the new verification keys with
- fellows
The list of Verification Keys in base58 format to add
- abstract def addNewLockTemplate(template: String, lockTemplate: LockTemplate[F]): F[Unit]
Add a new lock template entry to the wallet interaction's cartesian indexing.
Add a new lock template entry to the wallet interaction's cartesian indexing. Lock templates are at the y (template) layer. This new entry will be associated to the label given by template. The index of the new entry (and thus associated with the template label) will be automatically derived by the next available y-index.
- template
A String label of the template to associate the new lockTemplate entry with
- lockTemplate
The list of Lock Templates of the lock templates to add to the new Entries entry
- abstract def addPreimage(preimage: Preimage, digest: Digest): F[Unit]
Add a preimage secret associated to a digest proposition.
Add a preimage secret associated to a digest proposition.
- preimage
The preimage secret to add
- digest
The digest proposition for which the preimage is derived from.
- abstract def getAddress(fellowship: String, template: String, someInteraction: Option[Int]): F[Option[String]]
Get the lock address associated to the given fellowship, template and optional interaction
Get the lock address associated to the given fellowship, template and optional interaction
- fellowship
A String label of the fellowship to get the lock address for
- template
A String label of the template to get the lock address for
- someInteraction
The optional interaction index to get the lock address for. If not provided, the next interaction for the given fellowship and template pair will be used
- returns
The lock address for the given indices if possible. Else None
- abstract def getCurrentAddress: F[String]
Get the current address for the wallet interaction
Get the current address for the wallet interaction
- returns
The current address of the wallet interaction as a string in base58 encoding
- abstract def getCurrentIndicesForFunds(fellowship: String, template: String, someInteraction: Option[Int]): F[Option[Indices]]
Get the current indices for the given fellowship, template and optional interaction
Get the current indices for the given fellowship, template and optional interaction
- fellowship
A String label of the fellowship to get the indices for
- template
A String label of the template to get the indices for
- someInteraction
The optional interaction index of the indices. If not provided, the next interaction index for the given fellowship and template pair will be used
- returns
The indices for the given fellowship, template and optional interaction if possible. Else None
- abstract def getEntityVks(fellowship: String, template: String): F[Option[List[String]]]
Get the list of verification keys associated to the given pair of fellowship and template
Get the list of verification keys associated to the given pair of fellowship and template
- fellowship
A String label of the fellowship to get the verification keys for
- returns
The list of verification keys in base58 format associated to the given fellowship and template if possible. Else None. It is possible that the list of fellows is empty.
- abstract def getIndicesBySignature(signatureProposition: DigitalSignature): F[Option[Indices]]
Get the indices associated to a signature proposition
Get the indices associated to a signature proposition
- signatureProposition
The signature proposition to get the indices for
- returns
The indices associated to the signature proposition if it exists. Else None
- abstract def getInteractionList(fellowship: String, template: String): F[Option[List[(Indices, String)]]]
Get the list of interactions for the given fellowship and template.
Get the list of interactions for the given fellowship and template.
- fellowship
A String label of the fellowship to get the interactions for
- template
A String label of the template to get the interactions for
- returns
The list of interactions for the given fellowship and template if possible. If the fellowship or template do not exist it will return None.
- abstract def getLock(fellowship: String, template: String, nextInteraction: Int): F[Option[Lock]]
Using the template associated the given template, the verification keys associated to the fellowship and template pair, and the z interaction given by nextInteraction, build a Lock
Using the template associated the given template, the verification keys associated to the fellowship and template pair, and the z interaction given by nextInteraction, build a Lock
- fellowship
A String label of the fellowship to get the Lock verification keys for
- template
A String label of the template to get the verification keys and template for
- nextInteraction
The z index interaction to build the lock for
- returns
A built lock, if possible. Else none
- abstract def getLockByAddress(lockAddress: String): F[Option[Predicate]]
Get the lock predicate associated to the given lockAddress.
Get the lock predicate associated to the given lockAddress.
- lockAddress
The lockAddress for which we are retrieving the lock for
- returns
The lock predicate for the lockAddress if possible. Else None
- abstract def getLockByIndex(indices: Indices): F[Option[Predicate]]
Get the lock predicate associated to the given indices
Get the lock predicate associated to the given indices
- indices
The indices to get the lock predicate for
- returns
The lock predicate for the given indices if possible. Else None
- abstract def getLockTemplate(template: String): F[Option[LockTemplate[F]]]
Get the lock template associated to the given template
Get the lock template associated to the given template
- template
A String label of the template to get the lock template for
- returns
The lock template associated to the given template if possible. Else None.
- abstract def getNextIndicesForFunds(fellowship: String, template: String): F[Option[Indices]]
Get the next available indices for the given fellowship and template
Get the next available indices for the given fellowship and template
- fellowship
A String label of the fellowship to get the next indices for
- template
A String label of the template to get the next indices for
- returns
The next indices for the given fellowship and template if possible. Else None
- abstract def getPreimage(digestProposition: Digest): F[Option[Preimage]]
Get the preimage secret associated to a digest proposition.
Get the preimage secret associated to a digest proposition.
- digestProposition
The Digest Proposition for which to retrieve the preimage secret for
- returns
The preimage secret associated to the Digest Proposition if it exists. Else None
- abstract def initWalletState(networkId: Int, ledgerId: Int, mainKey: KeyPair): F[Unit]
Initialize the wallet interaction with the given key pair
Initialize the wallet interaction with the given key pair
- networkId
The network id to initialize the wallet interaction with
- ledgerId
The ledger id to initialize the wallet interaction with
- mainKey
The Topl Main verification key to initialize the wallet interaction with
- abstract def setCurrentIndices(fellowship: String, template: String, interaction: Int): F[Option[Indices]]
Set the current interaction for the given fellowship and template.
Set the current interaction for the given fellowship and template. In practice, this will remove all interactions after the given interaction index from the database, as the current interaction is the latest interaction. The interaction needs to be smaller or equal than the current interaction.
- fellowship
A String label of the fellowship to set the current interaction for
- template
A String label of the template to set the current interaction for
- interaction
The interaction index to set the current interaction to
- returns
The indices for the given fellowship, template and interaction. If the interaction is not valid, None.
- abstract def updateWalletState(lockPredicate: String, lockAddress: String, routine: Option[String], vk: Option[String], indices: Indices): F[Unit]
Update the wallet interaction with a new set of Predicate Lock, Lock Address, and their associated Indices
Update the wallet interaction with a new set of Predicate Lock, Lock Address, and their associated Indices
- lockPredicate
The lock predicate to add to the wallet interaction
- lockAddress
The lock address to add to the wallet interaction
- routine
The routine to add to the wallet interaction
- vk
The verification key to add to the wallet interaction
- indices
The indices to add to the wallet interaction
- abstract def validateCurrentIndicesForFunds(fellowship: String, template: String, someInteraction: Option[Int]): F[ValidatedNel[String, Indices]]
Validate that the supplied fellowship, template and optional interaction exist and are associated with each other in the current wallet interaction
Validate that the supplied fellowship, template and optional interaction exist and are associated with each other in the current wallet interaction
- fellowship
A String label of the fellowship to validate with
- template
A String label of the template to validate with
- someInteraction
The optional interaction index to validate with. If not provided, the next interaction for the given fellowship and template pair will be used
- returns
The indices for the given fellowship, template and optional interaction if valid. If not, the relevant errors
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)