TokenBalance

public struct TokenBalance : Codable, Identifiable, Hashable, TokenContractProtocol, TokenTransferActionsProtocol, AccountProtocol

ChainProvider the object that provides chain related configuration aspects of the Proton objects

  • id

    This is used as the primary key for storing the account

    Declaration

    Swift

    public var id: String { get }
  • accountId is used to link Account

    Declaration

    Swift

    public let accountId: String
  • tokenContractId is used to link TokenContract.

    Declaration

    Swift

    public let tokenContractId: String
  • The chainId associated with the TokenBalance

    Declaration

    Swift

    public let chainId: String
  • The Name of the contract. You can get the string value via contract.stringValue

    Declaration

    Swift

    public let contract: Name
  • The Asset amount. See EOSIO type Asset for more info

    Declaration

    Swift

    public var amount: Asset
  • When the tokebalance was updated. This will also be updated after tokenContract exchange rate was updated

    Declaration

    Swift

    public var updatedAt: Date
  • TokenContracts associated with this TokenBalance

    Declaration

    Swift

    public var tokenContract: TokenContract? { get }
  • TokenTransferActions associated with this TokenBalance

    Declaration

    Swift

    public var tokenTransferActions: [TokenTransferAction] { get }
  • Account associated with this TokenBalance

    Declaration

    Swift

    public var account: Account? { get }
  • Undocumented

    Declaration

    Swift

    public func getRate(forCurrencyCode currencyCode: String) -> Double
  • Currency balance

    Declaration

    Swift

    public func currencyBalance(forLocale locale: Locale = Locale(identifier: "en_US"), withStakedXPR: Bool = false) -> Double
  • Formated currency balance

    Declaration

    Swift

    public func currencyBalanceFormatted(forLocale locale: Locale = Locale(identifier: "en_US"), withStakedXPR: Bool = false) -> String
  • Formated balance without symbol and precision

    Declaration

    Swift

    public func balanceFormatted(forLocale locale: Locale = Locale(identifier: "en_US"),
                                 withSymbol symbol: Bool = false, andPrecision precision: Bool = false,
                                 withStakedXPR: Bool = false) -> String