Account
public struct Account : Codable, Hashable
extension Account: Identifiable
Fetching all the account balances is a lengthy task, involving many requests and parsing different structures. This struct abstract the developer away from knowing all these details, and instead allows developers to access wallets balances in a more normal approach
-
The wallet address
Declaration
Swift
public let walletAddress: String
-
The XTZ balance of the wallet
Declaration
Swift
public let xtzBalance: XTZAmount
-
The staked (locked) XTZ balance of the wallet
Declaration
Swift
public let xtzStakedBalance: XTZAmount
-
The unstaked (pending unlock) XTZ balance of the wallet
Declaration
Swift
public let xtzUnstakedBalance: XTZAmount
-
All the wallets FA1.2, FA2 funginble tokens
Declaration
Swift
public let tokens: [Token]
-
All the wallets NFT’s, grouped into parent FA2 objects so they can be displayed in groups or individaully
Declaration
Swift
public let nfts: [Token]
-
10 most recent NFTs to hit the wallet
Declaration
Swift
public var recentNFTs: [NFT]
-
All the wallets Defi, Liquidity Tokens
Declaration
Swift
public let liquidityTokens: [DipDupPositionData]
-
TzKT object containing baker details + status
Declaration
Swift
public let delegate: TzKTAccountDelegate?
-
The block level that the delegate was set
Declaration
Swift
public let delegationLevel: Decimal?
-
The total available (or spendable) balance of the account
Declaration
Swift
public var availableBalance: XTZAmount { get }
-
Basic init to default properties to zero / empty, so that optionals can be avoided on a key model throughout an app
Declaration
Swift
public init(walletAddress: String)
-
init(walletAddress:
xtzBalance: xtzStakedBalance: xtzUnstakedBalance: tokens: nfts: recentNFTs: liquidityTokens: delegate: delegationLevel: ) Full init
Declaration
Swift
public init(walletAddress: String, xtzBalance: XTZAmount, xtzStakedBalance: XTZAmount, xtzUnstakedBalance: XTZAmount, tokens: [Token], nfts: [Token], recentNFTs: [NFT], liquidityTokens: [DipDupPositionData], delegate: TzKTAccountDelegate?, delegationLevel: Decimal?)
-
Conforming to
Hashable
to enable working with UITableViewDiffableDataSourceDeclaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var id: String { get }