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) -> String
Parameters
seed
The seed.
index
An Index (0…∞).
checksum
Determines if the checksum should be included or not.
security
The security level, default 2.
multithreaded
If 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
txs
The 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
addresses
The 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
bundles
The bundles to categorize.
addresses
Addresses 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
addresses
The addresses list.
Return Value
Transactions list.
-
Calculates the checksum for a seed.
Declaration
Swift
public static func checksumForSeed(_ seed: String) -> String
Parameters
seed
The seed.
Return Value
The checksum