IotaMultisig

public class IotaMultisig: IotaDebuggable

Multisignature Iota Client.

  • Used to debug Iota messages, default false.

    Declaration

    Swift

    public var debug = false
  • Initializer for Iota Client.

    Declaration

    Swift

    public init(node: String, port: UInt)

    Parameters

    node

    A valid node URL.

    port

    A valid port.

  • Initialized for Iota Client

    Declaration

    Swift

    public init(node: String)

    Parameters

    node

    A valid node URL.

  • Gets the account data.

    Declaration

    Swift

    public func accountData(addresses: [String], findLastAddress: Bool = true, requestTransactions: Bool = false, _ success: @escaping (_ account: IotaAccount) -> Void, error: @escaping (Error) -> Void, log: ((_ log: IotaLog) -> Void)? = nil)

    Parameters

    addresses

    An Array of Iota Addresses.

    findLastAddress

    Find last address, default true.

    requestTransactions

    Request transactions, default false.

    success

    Success block.

    error

    Error block.

    log

    Log block, used to receive messages from Iota Client and updated the UI with useful messages.

  • Create the digest from Seed.

    Declaration

    Swift

    public func digest(seed: String, security: Int, index: Int) -> String

    Parameters

    seed

    A valid Iota Seed

    security

    The security value.

    index

    The index.

    Return Value

    Trytes String representing the digest.

  • Create an address from the digests.

    Declaration

    Swift

    public func address(fromDigests digests: [String]) -> String

    Parameters

    digests

    A valid array of digests.

    Return Value

    A valid IOTA Address.

  • Create a Key from the Seed.

    Declaration

    Swift

    public func key(seed: String, security: Int, index: Int) -> String

    Parameters

    seed

    A valid Seed.

    security

    A security value.

    index

    A valid index value.

    Return Value

    A key as String.

  • Validates an address using digests.

    Declaration

    Swift

    public func validate(address: String, digests: [String]) -> Bool

    Parameters

    address

    An address.

    digests

    A valid Array of digests.

    Return Value

    true if the address is valid, false otherwise.

  • Validates an address using digests as Trits.

    Declaration

    Swift

    public func validate(address: String, digests: [[Int]]) -> Bool

    Parameters

    address

    An address.

    digests

    A valid Array of digests as Trits.

    Return Value

    true if the address is valid, false otherwise.

  • Validates the signature for a IOTA Bundle

    Declaration

    Swift

    public func validateSignature(signedBundle: IotaBundle, inputAddress: String) -> Bool

    Parameters

    signedBundle

    A Iota Bundle.

    inputAddress

    The input address.

    Return Value

    true if the address is valid, false otherwise.

  • Prepares the transfers.

    Declaration

    Swift

    public func prepareTransfers(securitySum: Int, inputAddress: String, remainderAddress: String, transfers: [IotaTransfer], keys: [String], skipChecks: Bool = false, _ success: @escaping (_ bundle: IotaBundle) -> Void, error: @escaping (Error) -> Void)

    Parameters

    securitySum

    A security sum.

    inputAddress

    The input address.

    remainderAddress

    The remainder address.

    transfers

    An Array of IotaTransfer.

    keys

    An array of valid keys.

    skipChecks

    Skip checks. Default false.

    success

    The success block.

    error

    The error block.

  • Attaches an address to Tangle.

    Declaration

    Swift

    public func attachToTangle(securitySum: Int, address: String, keys: [String], _ success: @escaping (_ transactions: [IotaTransaction]) -> Void, error: @escaping (Error) -> Void)

    Parameters

    securitySum

    A security sum.

    address

    A valid IOTA Address.

    keys

    A valid Array of keys.

    success

    The success block.

    error

    The error block.

  • Sends transfers

    Declaration

    Swift

    public func sendTransfers(securitySum: Int, inputAddress: String, remainderAddress: String, transfers: [IotaTransfer], keys: [String], skipChecks: Bool = false, _ success: @escaping (_ transactions: [IotaTransaction]) -> Void, error: @escaping (Error) -> Void)

    Parameters

    securitySum

    A security sum.

    inputAddress

    The input address.

    remainderAddress

    The remainder address.

    transfers

    An Array of IotaTransfer.

    keys

    An array of keys.

    skipChecks

    Skip checks. Default false.

    success

    The success block.

    error

    The error block.

  • Adds the signature to a IotaBundle.

    Declaration

    Swift

    public func addSignature( bundle: inout IotaBundle, inputAddress: String, keyTrytes: String)

    Parameters

    bundle

    A IotaBundle, NB: as side effect, the IotaBundle object will be changed.

    inputAddress

    The input address.

    keyTrytes

    The Key Trites.