This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Get details of an order with the given ID - Get a list of orders Create and cancel orders had already been exposed.
- Loading branch information
1 parent
d13e62b
commit ccf8273
Showing
8 changed files
with
355 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Foundation | ||
|
||
// swiftlint:disable:next line_length | ||
/// Ordering options available for ``ImmutableX/listOrders(pageSize:cursor:orderBy:direction:user:status:minTimestamp:maxTimestamp:updatedMinTimestamp:updatedMaxTimestamp:buyTokenType:buyTokenId:buyAssetId:buyTokenAddress:buyTokenName:buyMinQuantity:buyMaxQuantity:buyMetadata:sellTokenType:sellTokenId:sellAssetId:sellTokenAddress:sellTokenName:sellMinQuantity:sellMaxQuantity:sellMetadata:auxiliaryFeePercentages:auxiliaryFeeRecipients:includeFees:)`` | ||
public enum ListOrdersOrderBy: String, CaseIterable { | ||
case createdAt = "created_at" | ||
case expiredAt = "expired_at" | ||
case sellQuantity = "sell_quantity" | ||
case buyQuantity = "buy_quantity" | ||
case buyQuantityWithFees = "buy_quantity_with_fees" | ||
case updatedAt = "updated_at" | ||
|
||
/// Converts this enum to the type expected by the generated API code | ||
internal var asApiArgument: OrdersAPI.OrderBy_listOrders { | ||
switch self { | ||
case .createdAt: | ||
return .createdAt | ||
case .expiredAt: | ||
return .expiredAt | ||
case .sellQuantity: | ||
return .sellQuantity | ||
case .buyQuantity: | ||
return .buyQuantity | ||
case .buyQuantityWithFees: | ||
return .buyQuantityWithFees | ||
case .updatedAt: | ||
return .updatedAt | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Foundation | ||
|
||
// swiftlint:disable:next line_length | ||
/// Status options available for ``ImmutableX/listOrders(pageSize:cursor:orderBy:direction:user:status:minTimestamp:maxTimestamp:updatedMinTimestamp:updatedMaxTimestamp:buyTokenType:buyTokenId:buyAssetId:buyTokenAddress:buyTokenName:buyMinQuantity:buyMaxQuantity:buyMetadata:sellTokenType:sellTokenId:sellAssetId:sellTokenAddress:sellTokenName:sellMinQuantity:sellMaxQuantity:sellMetadata:auxiliaryFeePercentages:auxiliaryFeeRecipients:includeFees:)`` | ||
public enum ListOrdersStatus: String, CaseIterable { | ||
case active | ||
case filled | ||
case cancelled | ||
case expired | ||
case inactive | ||
|
||
/// Converts this enum to the type expected by the generated API code | ||
internal var asApiArgument: OrdersAPI.Status_listOrders { | ||
switch self { | ||
case .active: | ||
return .active | ||
case .filled: | ||
return .filled | ||
case .cancelled: | ||
return .cancelled | ||
case .expired: | ||
return .expired | ||
case .inactive: | ||
return .inactive | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.