IotaAPIUtils
public struct IotaAPIUtils
Utils class for Iota
-
Generates a new address from a seed and a given index.
Declaration
Swift
public static func newAddress(seed: String, index: Int, checksum: Bool, security: Int = 2, multithreaded: Bool = false) -> StringParameters
seedThe seed.
indexAn Index (0…∞).
checksumDetermines if the checksum should be included or not.
securityThe security level, default 2.
multithreadedIf true, the work will be split to multiple threads.
Return Value
The generated address.
-
Groups a list of transactions by bundle.
Declaration
Swift
public static func groupTxsByBundle(_ txs: [IotaTransaction]) -> [[IotaTransaction]]Parameters
txsThe transactions list.
Return Value
A list of grouped transactions.
-
Categorizes the transfers into sent and received.
Declaration
Swift
public static func categorizeTransfers(addresses: [IotaAddress]) -> (sent: [[IotaTransaction]], received: [[IotaTransaction]])Parameters
addressesThe addresses list.
Return Value
Sent and received transactions.
-
Categorizes the transfers into sent and received.
Declaration
Swift
public static func categorizeTransfers(bundles: [[IotaTransaction]], addresses: [String]) -> (sent: [[IotaTransaction]], received: [[IotaTransaction]])Parameters
bundlesThe bundles to categorize.
addressesAddresses that belong to the user.
Return Value
Sent and received transactions.
-
Creates a transactions history from the addresses.
Declaration
Swift
public static func historyTransactions(addresses: [IotaAddress]) -> [IotaHistoryTransaction]Parameters
addressesThe addresses list.
Return Value
Transactions list.
-
Calculates the checksum for a seed.
Declaration
Swift
public static func checksumForSeed(_ seed: String) -> StringParameters
seedThe seed.
Return Value
The checksum
IotaAPIUtils Structure Reference