LocalTransaction

public struct LocalTransaction

Struct to represent a local transaction with the ability to locally sign via a secret passphrase

  • Transaction asset

    Declaration

    Swift

    public typealias Asset = [String: Any]
  • Type of transaction

    Declaration

    Swift

    public let type: TransactionType
  • Amount of Lisk to send

    Declaration

    Swift

    public let amount: UInt64
  • fee

    Fee to complete the transaction

    Declaration

    Swift

    public let fee: UInt64
  • The recipient of the amount being sent

    Declaration

    Swift

    public let recipientId: String?
  • Timestamp relative to Genesis epoch time

    Declaration

    Swift

    public let timestamp: UInt32
  • Additional transaction data

    Declaration

    Swift

    public let asset: Asset?
  • id

    Id of the transaction, only set after the transaction is signed

    Declaration

    Swift

    public private(set) var id: String?
  • Public key extracted from secret, only set after the transaction is signed

    Declaration

    Swift

    public private(set) var senderPublicKey: String?
  • Signature of the transaction, only set after the transaction is signed

    Declaration

    Swift

    public private(set) var signature: String?
  • Second sign-signature of the transaction, only set after the transaction is signed

    Declaration

    Swift

    public private(set) var signSignature: String?
  • Has this transaction been signed already

    Declaration

    Swift

    public var isSigned: Bool
  • Has this transaction been signed with a secret and second secret

    Declaration

    Swift

    public var isSecondSigned: Bool
  • Init

    Declaration

    Swift

    public init(_ type: TransactionType, amount: UInt64, recipientId: String? = nil, timestamp: UInt32? = nil, asset: Asset? = nil)
  • Init

    Declaration

    Swift

    public init(_ type: TransactionType, lsk: Double, recipientId: String? = nil, timestamp: UInt32? = nil, asset: Asset? = nil)
  • Init, copies transaction

    Declaration

    Swift

    public init(transaction: LocalTransaction)
  • Returns a new signed transaction based on this transaction

    Declaration

    Swift

    public func signed(keyPair: KeyPair, secondKeyPair: KeyPair? = nil) throws -> LocalTransaction
  • Returns a new signed transaction based on this transaction

    Declaration

    Swift

    public func signed(secret: String, secondSecret: String? = nil) throws -> LocalTransaction
  • Signs the current transaction

    Declaration

    Swift

    public mutating func sign(keyPair: KeyPair, secondKeyPair: KeyPair? = nil) throws
  • Signs the current transaction

    Declaration

    Swift

    public mutating func sign(secret: String, secondSecret: String? = nil) throws