Packages

trait WalletApi[F[_]] extends AnyRef

Defines a Wallet API. A Wallet is responsible for managing the user's keys

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WalletApi
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type ToMonad[G[_]] = FunctionK[F, G]

Abstract Value Members

  1. 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

  2. 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

  3. 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.

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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

  9. 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.

  10. 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".

  11. 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.

  12. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  6. 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

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  11. 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.

  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. 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

  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. 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.

  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped