Wallet

public protocol Wallet : Decodable, Encodable

Wallet protocol to allow generic handling of all wallets types for signing operations and caching data locally.

  • Which underlying WalletType is the wallet using

    Declaration

    Swift

    var type: WalletType { get }
  • The public TZ1 or TZ2 address of the wallet

    Declaration

    Swift

    var address: String { get }
  • Sign a hex string with the wallets private key

    Declaration

    Swift

    func sign(_ hex: String, isOperation: Bool, completion: @escaping ((Result<[UInt8], KukaiError>) -> Void))

    Parameters

    hex

    A hex encoded string, representing a forged operation payload.

    isOperation

    A boolean to indicate whether its an operation or something else such as an expression to sign. So that the appropriate prefix can be added automatically

    completion

    A completion block to run with the resulting signature, needs to be done async in order to support usecases such as signing with an external ledger.

  • Query which curve the given wallet is using

    Declaration

    Swift

    func privateKeyCurve() -> EllipticalCurve
  • Base58 encoded version of the publicKey, used when performing a reveal operation

    Declaration

    Swift

    func publicKeyBase58encoded() -> String