InformationFacade
public protocol InformationFacade
The interface of the class that provides information about a user’s account
-
Get the objects corresponding to the provided IDs.
Declaration
Swift
func getObjects<T>(type: T.Type, objectsIds: [String], completion: @escaping Completion<[T]>) where T: Decodable
Parameters
objectsIds
IDs of the objects to retrieve
completion
Callback which returns current block data or error
-
Retrieves full signed block
Declaration
Swift
func getBlock(blockNumber: Int, completion: @escaping Completion<Block>)
Parameters
blockNumber
Height of the block to be returned
completion
Callback which returns Block or error
-
Register new account in blockchain
Declaration
Swift
func registerAccount(name: String, password: String, completion: @escaping Completion<Bool>, noticeHandler: NoticeHandler?)
Parameters
name
The name of new account
password
The password wich will be used for create private keys
completion
Callback which returns bool result or error
noticeHandler
Callback which returns wher account has been created
-
Account function
Declaration
Swift
func getAccount(nameOrID: String, completion: @escaping Completion<Account>)
Parameters
nameOrID
Name or id of the account
completion
Callback in which the information will return account or error.
-
The function to check if there is an account
Declaration
Swift
func isAccountReserved(nameOrID: String, completion: @escaping Completion<Bool>)
Parameters
nameOrID
Name or id of the account
completion
Callback which returns true if there is such account, false if there is no or error
-
Account balance function
Declaration
Swift
func getBalance(nameOrID: String, asset: String?, completion: @escaping Completion<[AccountBalance]>)
Parameters
nameOrID
Name or id of the account
asset
Id of asset
completion
Callback which returns balances for a given asset or error
-
Function for getting account history
Note
To get the entire history, you can specify the initial id1.11.0
in the start ID and stop ID and then choose your limitDeclaration
Swift
func getAccountHistroy(nameOrID: String, startId: String, stopId: String, limit: Int, completion: @escaping Completion<[HistoryItem]>)
Parameters
nameOrID
Name or id of the account
startId
ID of the starting element of history
stopId
ID of the last element of the story
limit
Number of items in history
completion
Callback which returns history for account or error
-
Retrieve the current global property object.
Declaration
Swift
func getGlobalProperties(completion: @escaping Completion<GlobalProperties>)
Parameters
completion
Callback which returns GlobalProperties or error