TradableAccessToken

@objc public class TradableAccessToken: NSObject, NSCoding

Access token wrapper.

  • The token itself.

    Declaration

    Swift

    public let token: String
  • The refresh token to use in order to refresh the API authentication. Will be nil for OAuth flow.

    Declaration

    Swift

    public let refreshToken: String?
  • The endpoint URL from which the token was received.

    Declaration

    Swift

    public let endpointUrl: String
  • The expiration date for this token.

    Declaration

    Swift

    public let expirationDate: Date
  • The expiration date of the refresh token. Will be nil for OAuth flow.

    Declaration

    Swift

    public let refreshTokenExpirationDate: Date?
  • Simple description of this object.

    Declaration

    Swift

    public override var description: String
  • Creates an object with given parameters.

    Declaration

    Swift

    public init(token: String, endpointUrl: String, expiresIn: UInt64)
  • Creates an object with given parameters.

    Declaration

    Swift

    public init(token: String, endpointUrl: String, expirationDate: Date)
  • Returns the list of accounts for which this token is used.

    Declaration

    Swift

    public func getAccounts() -> [TradableAccount]
  • Removes the token from the keychain. If it’s an active token, nulls the SDK’s access token for the session.

    Declaration

    Swift

    public func dispose()
  • Creates an object with given parameters. Conforms to NSCoding protocol.

    Declaration

    Swift

    required convenience public init?(coder decoder: NSCoder)
  • Encoding method, conforming to NSCoding protocol.

    Declaration

    Swift

    public func encode(with aCoder: NSCoder)