trait WalletApi[F[_]] extends AnyRef
Defines a Wallet API. A Wallet is responsible for managing the user's keys
- Alphabetic
- By Inheritance
- WalletApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type ToMonad[G[_]] = FunctionK[F, G]
Abstract Value Members
- abstract def buildMainKeyVaultStore(mainKey: Array[Byte], password: Array[Byte]): F[VaultStore[F]]
Build a VaultStore for the wallet from a main key encrypted with a password
Build a VaultStore for the wallet from a main key encrypted with a password
- mainKey
The main key to use to generate the wallet
- password
The password to encrypt the wallet with
- returns
The mnemonic and VaultStore of the newly created wallet, if successful. Else an error
- abstract def createNewWallet(password: Array[Byte], passphrase: Option[String] = None, mLen: MnemonicSize = MnemonicSizes.words12): F[Either[WalletApiFailure, NewWalletResult[F]]]
Create a new wallet
Create a new wallet
- password
The password to encrypt the wallet with
- passphrase
The passphrase to use to generate the main key from the mnemonic
- mLen
The length of the mnemonic to generate
- returns
The mnemonic and VaultStore of the newly created wallet, if successful. Else an error
- abstract def deleteWallet(name: String = "default"): F[Either[WalletApiFailure, Unit]]
Delete a wallet
Delete a wallet
- name
A name used to identify the wallet. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
An error if unsuccessful.
- abstract def deriveChildKeys(keyPair: KeyPair, idx: Indices): F[KeyPair]
Derive a child key pair from a Main Key Pair.
Derive a child key pair from a Main Key Pair.
- keyPair
The Main Key Pair to derive the child key pair from
- idx
The path indices of the child key pair to derive
- returns
The protobuf encoded keys of the child key pair, if successful. Else an error
- abstract def deriveChildKeysPartial(keyPair: KeyPair, xFellowship: Int, yTemplate: Int): F[KeyPair]
Derive a child key pair from a Main Key Pair from a partial path (x and y).
Derive a child key pair from a Main Key Pair from a partial path (x and y).
- keyPair
The Main Key Pair to derive the child key pair from
- xFellowship
The first path index of the child key pair to derive. Represents the fellowship index
- yTemplate
The second path index of the child key pair to derive. Represents the contract index
- returns
The protobuf encoded keys of the child key pair
- abstract def deriveChildVerificationKey(vk: VerificationKey, idx: Int): F[VerificationKey]
Derive a child verification key pair one step down from a parent verification key.
Derive a child verification key pair one step down from a parent verification key. Note that this is a Soft Derivation.
- vk
The verification to derive the child key pair from
- idx
The index to perform soft derivation in order to derive the child verification
- returns
The protobuf child verification key
- abstract def extractMainKey(vaultStore: VaultStore[F], password: Array[Byte]): F[Either[WalletApiFailure, KeyPair]]
Extract the Main Key Pair from a wallet.
Extract the Main Key Pair from a wallet.
- vaultStore
The VaultStore of the wallet to extract the keys from
- returns
The protobuf encoded keys of the wallet, if successful. Else an error
- abstract def importWallet(mnemonic: IndexedSeq[String], password: Array[Byte], passphrase: Option[String] = None): F[Either[WalletApiFailure, VaultStore[F]]]
Import a wallet from a mnemonic.
Import a wallet from a mnemonic.
- mnemonic
The mnemonic to import
- password
The password to encrypt the wallet with
- passphrase
The passphrase to use to generate the main key from the mnemonic
- returns
The wallet's VaultStore if import and save was successful. An error if unsuccessful.
- Note
This method does not persist the imported wallet. It simply generates and returns the VaultStore corresponding to the mnemonic. See importWalletAndSave
- abstract def loadWallet(name: String = "default"): F[Either[WalletApiFailure, VaultStore[F]]]
Save a wallet
Save a wallet
- name
A name used to identify a wallet. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
The wallet's VaultStore if successful. An error if unsuccessful.
- abstract def saveMnemonic(mnemonic: IndexedSeq[String], mnemonicName: String): F[Either[WalletApiFailure, Unit]]
Save a mnemonic
Save a mnemonic
- mnemonic
The mnemonic to save
- mnemonicName
A name used to identify the mnemonic. Defaults to "mnemonic".
- abstract def saveWallet(vaultStore: VaultStore[F], name: String = "default"): F[Either[WalletApiFailure, Unit]]
Save a wallet
Save a wallet
- vaultStore
The VaultStore of the wallet to save
- name
A name used to identify a wallet. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
An error if unsuccessful.
- abstract def updateWallet(newWallet: VaultStore[F], name: String = "default"): F[Either[WalletApiFailure, Unit]]
Update a wallet
Update a wallet
- newWallet
The new VaultStore of the wallet
- name
A name used to identify a wallet. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
An error if unsuccessful.
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()
- def createAndSaveNewWallet[G[_]](password: Array[Byte], passphrase: Option[String] = None, mLen: MnemonicSize = MnemonicSizes.words12, name: String = "default", mnemonicName: String = "mnemonic")(implicit arg0: Monad[G], arg1: ToMonad[G]): G[Either[WalletApiFailure, NewWalletResult[F]]]
Create a new wallet and then save it
Create a new wallet and then save it
- password
The password to encrypt the wallet with
- passphrase
The passphrase to use to generate the main key from the mnemonic
- mLen
The length of the mnemonic to generate
- name
A name used to identify a wallet. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- mnemonicName
A name used to identify the mnemonic. Defaults to "mnemonic".
- returns
The mnemonic and VaultStore of the newly created wallet, if creation and save successful. Else an error
- 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()
- def importWalletAndSave[G[_]](mnemonic: IndexedSeq[String], password: Array[Byte], passphrase: Option[String] = None, name: String = "default")(implicit arg0: Monad[G], arg1: ToMonad[G]): G[Either[WalletApiFailure, VaultStore[F]]]
Import a wallet from a mnemonic and save it.
Import a wallet from a mnemonic and save it.
- mnemonic
The mnemonic to import
- password
The password to encrypt the wallet with
- passphrase
The passphrase to use to generate the main key from the mnemonic
- name
A name used to identify a wallet in the DataApi. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
The wallet's VaultStore if import and save was successful. An error if unsuccessful.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loadAndExtractMainKey[G[_]](password: Array[Byte], name: String = "default")(implicit arg0: Monad[G], arg1: ToMonad[G]): G[Either[WalletApiFailure, KeyPair]]
Load a wallet and then extract the main key pair
Load a wallet and then extract the main key pair
- password
The password to decrypt the wallet with
- name
A name used to identify a wallet in the DataApi. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
The main key pair of the wallet, if successful. Else an error
- 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
- def updateWalletPassword[G[_]](oldPassword: Array[Byte], newPassword: Array[Byte], name: String = "default")(implicit arg0: Monad[G], arg1: ToMonad[G]): G[Either[WalletApiFailure, VaultStore[F]]]
Update the password of a wallet
Update the password of a wallet
- oldPassword
The old password of the wallet
- newPassword
The new password to encrypt the wallet with
- name
A name used to identify a wallet in the DataApi. Defaults to "default". Most commonly, only one wallet identity will be used. It is the responsibility of the dApp to keep track of the names of the wallet identities if multiple will be used.
- returns
The wallet's new VaultStore if creation and save was successful. An error if unsuccessful.
- 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)