Account Management

Generate Account public/private keypair from a Mnemonic

Create account can be called after generating or importing the mnemonic which is the master seed. If the mnemonic does not exist on device, an error will be returned.

Abstrakt.shared.createAccount(nickName: String, blockchainNetwork: BlockchainNetwork, completion: @escaping (CompletionError?, Account?) -> Void)

Remove Account

Removing an account deletes the private/public key pair from the device and from the user’s profile. Note that deleting the last account, will delete the mnemonic that was used to generate the account as well. Hence, if the last account is deleted, all private keys and mnemonics are deleted from device.

Abstrakt.shared.removeAccount(blockchainNetwork: BlockchainNetwork, accountAddress: String, completion: ((CompletionError?, _ accountAddress: String?) -> Void)? = nil)

Get Account Balance

This function gets the account balance of any account the logged in user has in their acccount.

Abstrakt.shared.getAccountBalance(accountAddress: String, blockchainNetwork: BlockchainNetwork, completion: @escaping (_ accountBalance: Double, _ accountConversionBalance: Double) -> Void)

Get Account Object

Return Account Object

Abstrakt.shared.getMyAccounts(isTestnetEnabled: Bool, completion: @escaping ([Account]) -> Void)

Share Account

Abstrakt.shared.shareAccount(userId: String, blockchainNetwork: BlockchainNetwork, accountAddress: String, completion: ((CompletionError?, Account?) -> Void)? = nil)

Unshare Account

Abstrakt.shared.unshareAccount(userId: String, blockchainNetwork: BlockchainNetwork, accountAddress: String, completion: ((CompletionError?, Account?) -> Void)? = nil)

Get Shared Account From Other User’s UserId

Abstrakt.shared.getSharedAccountFromUserId(userId: String, completion: @escaping ([Account]) -> Void)

Get Account Keys

Work in Progress - Will return public & private keys of specified account