Account
public struct Account : Codable, Identifiable, Hashable, ChainProviderProtocol, TokenBalancesProtocol, AvatarProtocol, GlobalsXPRProtocol
Account is the Proton chain account object.
-
This is used as the primary key for storing the account
Declaration
Swift
public var id: String { get } -
The chainId associated with the account
Declaration
Swift
public var chainId: String -
The Name of the account. You can get the string value via name.stringValue
Declaration
Swift
public var name: Name -
Is the account KYC verified
Declaration
Swift
public var verified: Bool -
The user defined name
Declaration
Swift
public var userDefinedName: String -
The current key permissions for the account
Declaration
Swift
public var permissions: [API.V1.Chain.Permission] -
The user modified Avatar string
Declaration
Swift
public var base64Avatar: String -
The user modified Avatar string
Declaration
Swift
public var staking: Staking? -
The user modified Avatar string
Declaration
Swift
public var stakingRefund: StakingRefund? -
Get globalsXPR settings
Declaration
Swift
public var globalsXPR: GlobalsXPR? { get } -
ChainProvider associated with the Account
Declaration
Swift
public var chainProvider: ChainProvider? { get } -
TokenBalances associated with the Account
Declaration
Swift
public var tokenBalances: [TokenBalance] { get } -
XPR TokenBalance associated with the Account
Declaration
Swift
public var systemTokenBalance: TokenBalance? { get } -
Name formated with leading @
Declaration
Swift
public var nameWithAmpersand: String { get } -
Return name if not empty, else use the account name
Declaration
Swift
public var userDefinedNameOrName: String { get } -
Return true if account is qualified for rewards by staking and voting
Declaration
Swift
public var isStakingRewardQualified: Bool { get } -
Returns the max staking amount for the account.
Declaration
Swift
public var maxStakingAmount: Asset { get } -
Returns the first tokenBalance that has more than zero balance. System balance always takes precedence.
Declaration
Swift
public var firstAvailableTokenBalance: TokenBalance? { get } -
Undocumented
Declaration
Swift
public func totalCurrencyBalanceFormatted(forLocale locale: Locale = Locale(identifier: "en_US"), withStakedXPR: Bool = false) -> String -
Undocumented
Declaration
Swift
public func availableSystemBalanceFormatted(forLocale locale: Locale = Locale(identifier: "en_US"), withSymbol symbol: Bool = false, andPrecision precision: Bool = false) -> String -
Undocumented
Declaration
Swift
public func totalSystemBalanceFormatted(forLocale locale: Locale = Locale(identifier: "en_US"), withSymbol symbol: Bool = false, andPrecision precision: Bool = false) -> String -
Undocumented
Declaration
Swift
public func availableSystemBalance() -> Asset -
Undocumented
Declaration
Swift
public func totalSystemBalance() -> Asset -
Undocumented
Declaration
Swift
public func privateKey(forPermissionName: String, completion: @escaping ((Result<PrivateKey?, Error>) -> Void)) -
Check if the Account has private key stored within keychain for the passed permission
Declaration
Swift
public func hasStoredPrivateKey(forPermissionName permissionName: String) -> BoolParameters
forPermissionNameKey permission name. ex: active
Return Value
Bool
-
Check if the publickey is associated with the Account
Declaration
Swift
public func isKeyAssociated(publicKey: PublicKey) -> BoolParameters
publicKeyPublicKey
Return Value
Bool
-
Check if the publickey is associated with the Account
Declaration
Swift
public func isKeyAssociated(withPermissionName permissionName: String, forPublicKey publicKey: PublicKey) -> BoolParameters
withPermissionNameThe permission name. ex: active
publicKeyPublicKey
Return Value
Bool
-
Returns a set of keys associated with the Account
Declaration
Swift
public func uniquePublicKeys() -> Set<PublicKey>Return Value
Set<PublicKey>
Account Structure Reference