ZKExchange

Objective-C

@interface ZKExchange : NSObject

Swift

class ZKExchange : NSObject

Record containing exchange details.

  • Declaration

    Objective-C

    - (nonnull instancetype)initWithId:(nonnull NSString *)id
                                status:(nonnull NSString *)status
                                  pair:(nonnull NSString *)pair
                                  side:(nonnull NSString *)side
                                 price:(nonnull NSDecimalNumber *)price
                                amount:(nonnull NSDecimalNumber *)amount
                        debitAccountId:(nonnull NSString *)debitAccountId
                    debitTransactionId:(nullable NSString *)debitTransactionId
                       creditAccountId:(nonnull NSString *)creditAccountId
                   creditTransactionId:(nullable NSString *)creditTransactionId
                                 quote:(nonnull ZKQuote *)quote
                                 rates:(nonnull NSDictionary<NSString *, NSDictionary<NSString *, NSDecimalNumber *> *> *)rates
                                 nonce:(nullable NSString *)nonce
                             createdAt:(nonnull NSString *)createdAt
                             updatedAt:(nonnull NSString *)updatedAt;

    Swift

    init(id: String, status: String, pair: String, side: String, price: NSDecimalNumber, amount: NSDecimalNumber, debitAccountId: String, debitTransactionId: String?, creditAccountId: String, creditTransactionId: String?, quote: ZKQuote, rates: [String : [String : NSDecimalNumber]], nonce: String?, createdAt: String, updatedAt: String)
  • Declaration

    Objective-C

    + (nonnull instancetype)exchangeWithId:(nonnull NSString *)id
                                    status:(nonnull NSString *)status
                                      pair:(nonnull NSString *)pair
                                      side:(nonnull NSString *)side
                                     price:(nonnull NSDecimalNumber *)price
                                    amount:(nonnull NSDecimalNumber *)amount
                            debitAccountId:(nonnull NSString *)debitAccountId
                        debitTransactionId:(nullable NSString *)debitTransactionId
                           creditAccountId:(nonnull NSString *)creditAccountId
                       creditTransactionId:(nullable NSString *)creditTransactionId
                                     quote:(nonnull ZKQuote *)quote
                                     rates:(nonnull NSDictionary<NSString *, NSDictionary<NSString *, NSDecimalNumber *> *> *)rates
                                     nonce:(nullable NSString *)nonce
                                 createdAt:(nonnull NSString *)createdAt
                                 updatedAt:(nonnull NSString *)updatedAt;
  • id

    Identifier

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *id;

    Swift

    var id: String { get }
  • Exchange status.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *status;

    Swift

    var status: String { get }
  • Exchange pair, e.g. “ETH-GBP”.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *pair;

    Swift

    var pair: String { get }
  • Exchange side, “BUY” or “SELL”.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *side;

    Swift

    var side: String { get }
  • Exchange quote price.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSDecimalNumber *price;

    Swift

    var price: NSDecimalNumber { get }
  • Amount in base currency.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSDecimalNumber *amount;

    Swift

    var amount: NSDecimalNumber { get }
  • Debit ZKAccount identifier.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *debitAccountId;

    Swift

    var debitAccountId: String { get }
  • Debit ZKTransaction identifier.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *debitTransactionId;

    Swift

    var debitTransactionId: String? { get }
  • Credit ZKAccount identifier.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *creditAccountId;

    Swift

    var creditAccountId: String { get }
  • Credit ZKTransaction identifier.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *creditTransactionId;

    Swift

    var creditTransactionId: String? { get }
  • Exchange rate quote used.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) ZKQuote *quote;

    Swift

    var quote: ZKQuote { get }
  • Exchange rates at the time exchange was made. This can be used to display amounts in local currency to the user.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSDictionary<NSString *, NSDictionary<NSString *, NSDecimalNumber *> *> *rates;

    Swift

    var rates: [String : [String : NSDecimalNumber]] { get }
  • Exchange nonce or null. Used to prevent double spend.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *nonce;

    Swift

    var nonce: String? { get }
  • Timestamp when exchange was created, e.g. “2020-07-29T09:46:34.288Z”.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *createdAt;

    Swift

    var createdAt: String { get }
  • Timestamp when exchange was updated, e.g. “2020-07-29T09:46:34.288Z”.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *updatedAt;

    Swift

    var updatedAt: String { get }