diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml
index 4f75b791e..eeead0334 100644
--- a/.github/workflows/linter.yml
+++ b/.github/workflows/linter.yml
@@ -57,7 +57,7 @@ jobs:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*)
+ FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*|.*src/Packages/Orderbook)
VALIDATE_MARKDOWN: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
diff --git a/sample/Packages/manifest.json b/sample/Packages/manifest.json
index 36aedebd7..7fb0ae9b3 100644
--- a/sample/Packages/manifest.json
+++ b/sample/Packages/manifest.json
@@ -3,6 +3,8 @@
"com.alttester.sdk": "2.1.1",
"com.cysharp.unitask": "2.3.3",
"com.immutable.passport": "file:../../src/Packages/Passport",
+ "com.immutable.marketplace": "file:../../src/Packages/Marketplace",
+ "com.immutable.orderbook": "file:../../src/Packages/Orderbook",
"com.unity.ai.navigation": "1.1.4",
"com.unity.ide.visualstudio": "2.0.21",
"com.unity.ide.vscode": "1.2.5",
diff --git a/src/Packages/Orderbook/CHANGELOG.md b/src/Packages/Orderbook/CHANGELOG.md
new file mode 100644
index 000000000..e602bd7aa
--- /dev/null
+++ b/src/Packages/Orderbook/CHANGELOG.md
@@ -0,0 +1,3 @@
+# Changelog
+
+Please see https://github.com/immutable/unity-immutable-sdk/releases
\ No newline at end of file
diff --git a/src/Packages/Orderbook/CHANGELOG.md.meta b/src/Packages/Orderbook/CHANGELOG.md.meta
new file mode 100644
index 000000000..26f5bcedf
--- /dev/null
+++ b/src/Packages/Orderbook/CHANGELOG.md.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d0757b46231bb46b5838eb8c02ee07f7
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Documentation~/Action.md b/src/Packages/Orderbook/Documentation~/Action.md
new file mode 100644
index 000000000..535eff0b8
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/Action.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.Action
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------------|-----------------------------------------------------------------------------------------|-------------|------------
+ **PopulatedTransactions** | [**TransactionActionPopulatedTransactions**](TransactionActionPopulatedTransactions.md) | | [optional]
+ **Purpose** | **SignablePurpose** | | [optional]
+ **Type** | **string** | |
+ **Message** | [**SignableActionMessage**](SignableActionMessage.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/BigNumberish.md b/src/Packages/Orderbook/Documentation~/BigNumberish.md
new file mode 100644
index 000000000..ece3cc9a9
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/BigNumberish.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.BigNumberish
+
+Any type that can be used where a big number is needed.
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrders200Response.md b/src/Packages/Orderbook/Documentation~/CancelOrders200Response.md
new file mode 100644
index 000000000..36c1b1853
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrders200Response.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.CancelOrders200Response
+
+Response schema for the cancelOrder endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+------------|-----------------------------------------------------------------------|-------------|------------
+ **Result** | [**CancelOrders200ResponseResult**](CancelOrders200ResponseResult.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResult.md b/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResult.md
new file mode 100644
index 000000000..dd56ffc6a
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResult.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.CancelOrders200ResponseResult
+
+## Properties
+
+ Name | Type | Description | Notes
+-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|------------
+ **FailedCancellations** | [**List<CancelOrders200ResponseResultFailedCancellationsInner>**](CancelOrders200ResponseResultFailedCancellationsInner.md) | Orders which failed to be cancelled | [optional]
+ **PendingCancellations** | **List<string>** | Orders which are marked for cancellation but the cancellation cannot be guaranteed | [optional]
+ **SuccessfulCancellations** | **List<string>** | Orders which were successfully cancelled | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResultFailedCancellationsInner.md b/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResultFailedCancellationsInner.md
new file mode 100644
index 000000000..db569e6c0
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrders200ResponseResultFailedCancellationsInner.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.CancelOrders200ResponseResultFailedCancellationsInner
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------|------------|-------------------------------------------------------------|------------
+ **Order** | **string** | ID of the order which failed to be cancelled | [optional]
+ **ReasonCode** | **string** | Reason code indicating why the order failed to be cancelled | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrdersOnChain200Response.md b/src/Packages/Orderbook/Documentation~/CancelOrdersOnChain200Response.md
new file mode 100644
index 000000000..aef8f81df
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrdersOnChain200Response.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.CancelOrdersOnChain200Response
+
+Response schema for the cancelOrder endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+------------------------|-----------------------------------------------|-------------|------------
+ **CancellationAction** | [**TransactionAction**](TransactionAction.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrdersOnChainRequest.md b/src/Packages/Orderbook/Documentation~/CancelOrdersOnChainRequest.md
new file mode 100644
index 000000000..6f574b780
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrdersOnChainRequest.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.CancelOrdersOnChainRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------|------------------------|-------------|-------
+ **OrderIds** | **List<string>** | |
+ **AccountAddress** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelOrdersRequest.md b/src/Packages/Orderbook/Documentation~/CancelOrdersRequest.md
new file mode 100644
index 000000000..1acb6e201
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelOrdersRequest.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.CancelOrdersRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------|------------------------|-------------|-------
+ **OrderIds** | **List<string>** | |
+ **AccountAddress** | **string** | |
+ **Signature** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancellationType.md b/src/Packages/Orderbook/Documentation~/CancellationType.md
new file mode 100644
index 000000000..695b14f71
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancellationType.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.CancellationType
+
+Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CancelledOrderStatusCancellationType.md b/src/Packages/Orderbook/Documentation~/CancelledOrderStatusCancellationType.md
new file mode 100644
index 000000000..335d6f1bf
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CancelledOrderStatusCancellationType.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.CancelledOrderStatusCancellationType
+
+Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CreateListing200Response.md b/src/Packages/Orderbook/Documentation~/CreateListing200Response.md
new file mode 100644
index 000000000..30ccb5d75
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CreateListing200Response.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.CreateListing200Response
+
+The response schema for the create listing endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+------------|-----------------------|-------------|------------
+ **Result** | [**Order**](Order.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/CreateListingRequest.md b/src/Packages/Orderbook/Documentation~/CreateListingRequest.md
new file mode 100644
index 000000000..e6e87f6b9
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/CreateListingRequest.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.CreateListingRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|-------------------------------------------|-------------|-------
+ **MakerFees** | [**List<FeeValue>**](FeeValue.md) | |
+ **OrderComponents** | [**OrderComponents**](OrderComponents.md) | |
+ **OrderHash** | **string** | |
+ **OrderSignature** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/ERC1155Item.md b/src/Packages/Orderbook/Documentation~/ERC1155Item.md
new file mode 100644
index 000000000..a8370a280
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/ERC1155Item.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.ERC1155Item
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **ContractAddress** | **string** | |
+ **TokenId** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/ERC20Item.md b/src/Packages/Orderbook/Documentation~/ERC20Item.md
new file mode 100644
index 000000000..84bd07368
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/ERC20Item.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.ERC20Item
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **ContractAddress** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/ERC721Item.md b/src/Packages/Orderbook/Documentation~/ERC721Item.md
new file mode 100644
index 000000000..e2aff1a10
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/ERC721Item.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.ERC721Item
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|------------|-------------|-------
+ **ContractAddress** | **string** | |
+ **TokenId** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/Fee.md b/src/Packages/Orderbook/Documentation~/Fee.md
new file mode 100644
index 000000000..3444d4b22
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/Fee.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.Fee
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------------|-------------|-------------|------------
+ **Amount** | **string** | | [optional]
+ **RecipientAddress** | **string** | | [optional]
+ **Type** | **FeeType** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/FeeType.md b/src/Packages/Orderbook/Documentation~/FeeType.md
new file mode 100644
index 000000000..813b7b0af
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/FeeType.md
@@ -0,0 +1,9 @@
+# Immutable.Orderbook.Model.FeeType
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/FeeValue.md b/src/Packages/Orderbook/Documentation~/FeeValue.md
new file mode 100644
index 000000000..218c86db0
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/FeeValue.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.FeeValue
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **RecipientAddress** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/FulfillOrder200Response.md b/src/Packages/Orderbook/Documentation~/FulfillOrder200Response.md
new file mode 100644
index 000000000..f62bd03b7
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/FulfillOrder200Response.md
@@ -0,0 +1,14 @@
+# Immutable.Orderbook.Model.FulfillOrder200Response
+
+Response schema for the fulfillOrder endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------|-----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|------------
+ **Actions** | [**List<TransactionAction>**](TransactionAction.md) | | [optional]
+ **Expiration** | **string** | User MUST submit the fulfillment transaction before the expiration Submitting after the expiration will result in a on chain revert | [optional]
+ **Order** | [**Order**](Order.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/FulfillOrderRequest.md b/src/Packages/Orderbook/Documentation~/FulfillOrderRequest.md
new file mode 100644
index 000000000..e9c070e29
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/FulfillOrderRequest.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.FulfillOrderRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+------------------|-------------------------------------------------------------------------------------------|--------------|------------
+ **ListingId** | **string** | listingId |
+ **TakerAddress** | **string** | takerAddress |
+ **TakerFees** | [**List<FulfillOrderRequestTakerFeesInner>**](FulfillOrderRequestTakerFeesInner.md) | takerFees |
+ **AmountToFill** | **string** | amountToFill | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/FulfillOrderRequestTakerFeesInner.md b/src/Packages/Orderbook/Documentation~/FulfillOrderRequestTakerFeesInner.md
new file mode 100644
index 000000000..f967cb6d0
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/FulfillOrderRequestTakerFeesInner.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.FulfillOrderRequestTakerFeesInner
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **RecipientAddress** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/ItemType.md b/src/Packages/Orderbook/Documentation~/ItemType.md
new file mode 100644
index 000000000..ea5ec9ac6
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/ItemType.md
@@ -0,0 +1,9 @@
+# Immutable.Orderbook.Model.ItemType
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/NativeItem.md b/src/Packages/Orderbook/Documentation~/NativeItem.md
new file mode 100644
index 000000000..5c6572e2c
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/NativeItem.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.NativeItem
+
+## Properties
+
+ Name | Type | Description | Notes
+------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/Order.md b/src/Packages/Orderbook/Documentation~/Order.md
new file mode 100644
index 000000000..1781807d0
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/Order.md
@@ -0,0 +1,26 @@
+# Immutable.Orderbook.Model.Order
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------|---------------------------------------------------------------------------|-------------------------------------------------|------------
+ **AccountAddress** | **string** | | [optional]
+ **Buy** | [**List<PrepareListingRequestBuy>**](PrepareListingRequestBuy.md) | | [optional]
+ **Chain** | [**OrderChain**](OrderChain.md) | | [optional]
+ **CreatedAt** | **string** | | [optional]
+ **EndAt** | **string** | Time after which the Order is expired | [optional]
+ **Fees** | [**List<Fee>**](Fee.md) | | [optional]
+ **FillStatus** | [**OrderFillStatus**](OrderFillStatus.md) | | [optional]
+ **Id** | **string** | |
+ **OrderHash** | **string** | |
+ **ProtocolData** | [**OrderProtocolData**](OrderProtocolData.md) | | [optional]
+ **Salt** | **string** | | [optional]
+ **Sell** | [**List<PrepareListingRequestSell>**](PrepareListingRequestSell.md) | |
+ **Signature** | **string** | |
+ **StartAt** | **string** | Time after which the Order is considered active |
+ **Status** | [**OrderStatus**](OrderStatus.md) | |
+ **Type** | **string** | |
+ **UpdatedAt** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderChain.md b/src/Packages/Orderbook/Documentation~/OrderChain.md
new file mode 100644
index 000000000..b6c2da9d1
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderChain.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.OrderChain
+
+## Properties
+
+ Name | Type | Description | Notes
+----------|------------|-------------|------------
+ **Id** | **string** | | [optional]
+ **Name** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderComponents.md b/src/Packages/Orderbook/Documentation~/OrderComponents.md
new file mode 100644
index 000000000..b9c589d6d
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderComponents.md
@@ -0,0 +1,21 @@
+# Immutable.Orderbook.Model.OrderComponents
+
+## Properties
+
+ Name | Type | Description | Notes
+-------------------------------------|-------------------------------------------------------------------------------------------|-------------|-------
+ **ConduitKey** | **string** | |
+ **Consideration** | [**List<OrderComponentsConsiderationInner>**](OrderComponentsConsiderationInner.md) | |
+ **EndTime** | **string** | |
+ **Offer** | [**List<OrderComponentsOfferInner>**](OrderComponentsOfferInner.md) | |
+ **Offerer** | **string** | |
+ **OrderType** | **OrderType** | |
+ **Salt** | **string** | |
+ **StartTime** | **string** | |
+ **TotalOriginalConsiderationItems** | **string** | |
+ **Zone** | **string** | |
+ **ZoneHash** | **string** | |
+ **Counter** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderComponentsConsiderationInner.md b/src/Packages/Orderbook/Documentation~/OrderComponentsConsiderationInner.md
new file mode 100644
index 000000000..c7acc04e4
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderComponentsConsiderationInner.md
@@ -0,0 +1,15 @@
+# Immutable.Orderbook.Model.OrderComponentsConsiderationInner
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------------|--------------|-------------|-------
+ **EndAmount** | **string** | |
+ **IdentifierOrCriteria** | **string** | |
+ **ItemType** | **ItemType** | |
+ **Recipient** | **string** | |
+ **StartAmount** | **string** | |
+ **Token** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderComponentsOfferInner.md b/src/Packages/Orderbook/Documentation~/OrderComponentsOfferInner.md
new file mode 100644
index 000000000..9d24ac808
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderComponentsOfferInner.md
@@ -0,0 +1,14 @@
+# Immutable.Orderbook.Model.OrderComponentsOfferInner
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------------|--------------|-------------|-------
+ **EndAmount** | **string** | |
+ **IdentifierOrCriteria** | **string** | |
+ **ItemType** | **ItemType** | |
+ **StartAmount** | **string** | |
+ **Token** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderFillStatus.md b/src/Packages/Orderbook/Documentation~/OrderFillStatus.md
new file mode 100644
index 000000000..491954766
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderFillStatus.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.OrderFillStatus
+
+## Properties
+
+ Name | Type | Description | Notes
+-----------------|------------|-------------|------------
+ **Denominator** | **string** | | [optional]
+ **Numerator** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderProtocolData.md b/src/Packages/Orderbook/Documentation~/OrderProtocolData.md
new file mode 100644
index 000000000..19ce01c35
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderProtocolData.md
@@ -0,0 +1,14 @@
+# Immutable.Orderbook.Model.OrderProtocolData
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------|------------|-------------|------------
+ **Counter** | **string** | | [optional]
+ **OrderType** | **string** | | [optional]
+ **SeaportAddress** | **string** | | [optional]
+ **SeaportVersion** | **string** | | [optional]
+ **ZoneAddress** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatus.md b/src/Packages/Orderbook/Documentation~/OrderStatus.md
new file mode 100644
index 000000000..aaa36f633
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatus.md
@@ -0,0 +1,18 @@
+# Immutable.Orderbook.Model.OrderStatus
+
+The Order status
+
+## Properties
+
+ Name | Type | Description | Notes
+-------------------------|----------------------|---------------------------------------------------------------------------------------|------------
+ **Name** | **string** | The order status that indicates the order is yet to be active due to various reasons. | [optional]
+ **CancellationType** | **CancellationType** | | [optional]
+ **Pending** | **bool** | Whether the cancellation of the order is pending | [optional]
+ **SufficientApprovals** | **bool** | Whether the order offerer has sufficient approvals | [optional]
+ **SufficientBalances** | **bool** | Whether the order offerer still has sufficient balance to complete the order | [optional]
+ **Evaluated** | **bool** | Whether the order has been evaluated after its creation | [optional]
+ **Started** | **bool** | Whether the order has reached its specified start time | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf.md
new file mode 100644
index 000000000..c477d561e
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf.md
@@ -0,0 +1,10 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf
+
+## Properties
+
+ Name | Type | Description | Notes
+----------|------------|------------------------------------------------------------|------------
+ **Name** | **string** | The order status that indicates an order can be fulfilled. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf1.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf1.md
new file mode 100644
index 000000000..77032082a
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf1.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf1
+
+## Properties
+
+ Name | Type | Description | Notes
+----------------------|----------------------|-------------------------------------------------------------------------------------|------------
+ **CancellationType** | **CancellationType** | | [optional]
+ **Name** | **string** | The order status indicating a order is has been cancelled or about to be cancelled. | [optional]
+ **Pending** | **bool** | Whether the cancellation of the order is pending | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf2.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf2.md
new file mode 100644
index 000000000..2b7f87464
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf2.md
@@ -0,0 +1,10 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf2
+
+## Properties
+
+ Name | Type | Description | Notes
+----------|------------|-------------------------------------------------------------------------------------|------------
+ **Name** | **string** | A terminal order status indicating that an order cannot be fulfilled due to expiry. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf3.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf3.md
new file mode 100644
index 000000000..5c1521113
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf3.md
@@ -0,0 +1,10 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf3
+
+## Properties
+
+ Name | Type | Description | Notes
+----------|------------|----------------------------------------------------------------------|------------
+ **Name** | **string** | A terminal order status indicating that an order has been fulfilled. | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf4.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf4.md
new file mode 100644
index 000000000..08ef4965d
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf4.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf4
+
+## Properties
+
+ Name | Type | Description | Notes
+-------------------------|------------|------------------------------------------------------------------------------|------------
+ **Name** | **string** | The order status that indicates an order cannot be fulfilled. | [optional]
+ **SufficientApprovals** | **bool** | Whether the order offerer has sufficient approvals | [optional]
+ **SufficientBalances** | **bool** | Whether the order offerer still has sufficient balance to complete the order | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderStatusOneOf5.md b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf5.md
new file mode 100644
index 000000000..2d6681a9a
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderStatusOneOf5.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.OrderStatusOneOf5
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------|------------|---------------------------------------------------------------------------------------|------------
+ **Evaluated** | **bool** | Whether the order has been evaluated after its creation | [optional]
+ **Name** | **string** | The order status that indicates the order is yet to be active due to various reasons. | [optional]
+ **Started** | **bool** | Whether the order has reached its specified start time | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderType.md b/src/Packages/Orderbook/Documentation~/OrderType.md
new file mode 100644
index 000000000..7b8a38591
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderType.md
@@ -0,0 +1,9 @@
+# Immutable.Orderbook.Model.OrderType
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/OrderbookApi.md b/src/Packages/Orderbook/Documentation~/OrderbookApi.md
new file mode 100644
index 000000000..53ebca76c
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/OrderbookApi.md
@@ -0,0 +1,640 @@
+# Immutable.Orderbook.Api.OrderbookApi
+
+All URIs are relative to *https://api.immutable.com*
+
+| Method | HTTP request | Description |
+|----------------------------------------------------------------------------|---------------------------------------------------------|-------------|
+| [**CancelOrders**](OrderbookApi.md#cancelorders) | **POST** /v1/ts-sdk/orderbook/cancelOrders | |
+| [**CancelOrdersOnChain**](OrderbookApi.md#cancelordersonchain) | **POST** /v1/ts-sdk/orderbook/cancelOrdersOnChain | |
+| [**CreateListing**](OrderbookApi.md#createlisting) | **POST** /v1/ts-sdk/orderbook/createListing | |
+| [**FulfillOrder**](OrderbookApi.md#fulfillorder) | **POST** /v1/ts-sdk/orderbook/fulfillOrder | |
+| [**PrepareListing**](OrderbookApi.md#preparelisting) | **POST** /v1/ts-sdk/orderbook/prepareListing | |
+| [**PrepareOrderCancellations**](OrderbookApi.md#prepareordercancellations) | **POST** /v1/ts-sdk/orderbook/prepareOrderCancellations | |
+| [**TokenBalance**](OrderbookApi.md#tokenbalance) | **GET** /v1/ts-sdk/token/balance | |
+
+
+
+# **CancelOrders**
+
+> CancelOrders200Response CancelOrders (CancelOrdersRequest? cancelOrdersRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class CancelOrdersExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var cancelOrdersRequest = new CancelOrdersRequest?(); // CancelOrdersRequest? | (optional)
+
+ try
+ {
+ CancelOrders200Response result = apiInstance.CancelOrders(cancelOrdersRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.CancelOrders: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the CancelOrdersWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.CancelOrdersWithHttpInfo(cancelOrdersRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.CancelOrdersWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|-------------------------|-----------------------------------------------------|-------------|------------|
+| **cancelOrdersRequest** | [**CancelOrdersRequest?**](CancelOrdersRequest?.md) | | [optional] |
+
+### Return type
+
+[**CancelOrders200Response**](CancelOrders200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|----------------------------------------------|------------------|
+| **200** | Response schema for the cancelOrder endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **CancelOrdersOnChain**
+
+> CancelOrdersOnChain200Response CancelOrdersOnChain (CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class CancelOrdersOnChainExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var cancelOrdersOnChainRequest = new CancelOrdersOnChainRequest?(); // CancelOrdersOnChainRequest? | (optional)
+
+ try
+ {
+ CancelOrdersOnChain200Response result = apiInstance.CancelOrdersOnChain(cancelOrdersOnChainRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.CancelOrdersOnChain: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the CancelOrdersOnChainWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.CancelOrdersOnChainWithHttpInfo(cancelOrdersOnChainRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.CancelOrdersOnChainWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|--------------------------------|-------------------------------------------------------------------|-------------|------------|
+| **cancelOrdersOnChainRequest** | [**CancelOrdersOnChainRequest?**](CancelOrdersOnChainRequest?.md) | | [optional] |
+
+### Return type
+
+[**CancelOrdersOnChain200Response**](CancelOrdersOnChain200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|----------------------------------------------|------------------|
+| **200** | Response schema for the cancelOrder endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **CreateListing**
+
+> CreateListing200Response CreateListing (CreateListingRequest? createListingRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class CreateListingExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var createListingRequest = new CreateListingRequest?(); // CreateListingRequest? | (optional)
+
+ try
+ {
+ CreateListing200Response result = apiInstance.CreateListing(createListingRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.CreateListing: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the CreateListingWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.CreateListingWithHttpInfo(createListingRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.CreateListingWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|--------------------------|-------------------------------------------------------|-------------|------------|
+| **createListingRequest** | [**CreateListingRequest?**](CreateListingRequest?.md) | | [optional] |
+
+### Return type
+
+[**CreateListing200Response**](CreateListing200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-----------------------------------------------------|------------------|
+| **200** | The response schema for the create listing endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **FulfillOrder**
+
+> FulfillOrder200Response FulfillOrder (FulfillOrderRequest? fulfillOrderRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class FulfillOrderExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var fulfillOrderRequest = new FulfillOrderRequest?(); // FulfillOrderRequest? | (optional)
+
+ try
+ {
+ FulfillOrder200Response result = apiInstance.FulfillOrder(fulfillOrderRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.FulfillOrder: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the FulfillOrderWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.FulfillOrderWithHttpInfo(fulfillOrderRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.FulfillOrderWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|-------------------------|-----------------------------------------------------|-------------|------------|
+| **fulfillOrderRequest** | [**FulfillOrderRequest?**](FulfillOrderRequest?.md) | | [optional] |
+
+### Return type
+
+[**FulfillOrder200Response**](FulfillOrder200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-----------------------------------------------|------------------|
+| **200** | Response schema for the fulfillOrder endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **PrepareListing**
+
+> PrepareListing200Response PrepareListing (PrepareListingRequest? prepareListingRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class PrepareListingExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var prepareListingRequest = new PrepareListingRequest?(); // PrepareListingRequest? | (optional)
+
+ try
+ {
+ PrepareListing200Response result = apiInstance.PrepareListing(prepareListingRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.PrepareListing: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the PrepareListingWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.PrepareListingWithHttpInfo(prepareListingRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.PrepareListingWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|---------------------------|---------------------------------------------------------|-------------|------------|
+| **prepareListingRequest** | [**PrepareListingRequest?**](PrepareListingRequest?.md) | | [optional] |
+
+### Return type
+
+[**PrepareListing200Response**](PrepareListing200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|-------------------------------------------------|------------------|
+| **200** | Response schema for the prepareListing endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **PrepareOrderCancellations**
+
+> PrepareOrderCancellations200Response PrepareOrderCancellations (PrepareOrderCancellationsRequest?
+> prepareOrderCancellationsRequest = null)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class PrepareOrderCancellationsExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var prepareOrderCancellationsRequest = new PrepareOrderCancellationsRequest?(); // PrepareOrderCancellationsRequest? | (optional)
+
+ try
+ {
+ PrepareOrderCancellations200Response result = apiInstance.PrepareOrderCancellations(prepareOrderCancellationsRequest);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.PrepareOrderCancellations: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the PrepareOrderCancellationsWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.PrepareOrderCancellationsWithHttpInfo(prepareOrderCancellationsRequest);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.PrepareOrderCancellationsWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|--------------------------------------|-------------------------------------------------------------------------------|-------------|------------|
+| **prepareOrderCancellationsRequest** | [**PrepareOrderCancellationsRequest?**](PrepareOrderCancellationsRequest?.md) | | [optional] |
+
+### Return type
+
+[**PrepareOrderCancellations200Response**](PrepareOrderCancellations200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|------------------------------------------------------------|------------------|
+| **200** | Response schema for the prepareOrderCancellations endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
+
+
+# **TokenBalance**
+
+> TokenBalance200Response TokenBalance (string walletAddress, string contractAddress)
+
+### Example
+
+```csharp
+using System.Collections.Generic;
+using System.Diagnostics;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Example
+{
+ public class TokenBalanceExample
+ {
+ public static void Main()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var walletAddress = "walletAddress_example"; // string |
+ var contractAddress = "contractAddress_example"; // string |
+
+ try
+ {
+ TokenBalance200Response result = apiInstance.TokenBalance(walletAddress, contractAddress);
+ Debug.WriteLine(result);
+ }
+ catch (ApiException e)
+ {
+ Debug.Print("Exception when calling OrderbookApi.TokenBalance: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+ }
+ }
+ }
+}
+```
+
+#### Using the TokenBalanceWithHttpInfo variant
+
+This returns an ApiResponse object which contains the response data, status code and headers.
+
+```csharp
+try
+{
+ ApiResponse response = apiInstance.TokenBalanceWithHttpInfo(walletAddress, contractAddress);
+ Debug.Write("Status Code: " + response.StatusCode);
+ Debug.Write("Response Headers: " + response.Headers);
+ Debug.Write("Response Body: " + response.Data);
+}
+catch (ApiException e)
+{
+ Debug.Print("Exception when calling OrderbookApi.TokenBalanceWithHttpInfo: " + e.Message);
+ Debug.Print("Status Code: " + e.ErrorCode);
+ Debug.Print(e.StackTrace);
+}
+```
+
+### Parameters
+
+| Name | Type | Description | Notes |
+|---------------------|------------|-------------|-------|
+| **walletAddress** | **string** | | |
+| **contractAddress** | **string** | | |
+
+### Return type
+
+[**TokenBalance200Response**](TokenBalance200Response.md)
+
+### Authorization
+
+No authorization required
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+### HTTP response details
+
+| Status code | Description | Response headers |
+|-------------|------------------------------------------------------|------------------|
+| **200** | The response body returned from get balance endpoint | - |
+
+[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareListing200Response.md b/src/Packages/Orderbook/Documentation~/PrepareListing200Response.md
new file mode 100644
index 000000000..6dad51d83
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareListing200Response.md
@@ -0,0 +1,14 @@
+# Immutable.Orderbook.Model.PrepareListing200Response
+
+Response schema for the prepareListing endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|-------------------------------------------|-------------|-------
+ **Actions** | [**List<Action>**](Action.md) | |
+ **OrderComponents** | [**OrderComponents**](OrderComponents.md) | |
+ **OrderHash** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareListingRequest.md b/src/Packages/Orderbook/Documentation~/PrepareListingRequest.md
new file mode 100644
index 000000000..8e6a60c8d
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareListingRequest.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.PrepareListingRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+------------------|---------------------------------------------------------------|-------------|------------
+ **Buy** | [**PrepareListingRequestBuy**](PrepareListingRequestBuy.md) | |
+ **MakerAddress** | **string** | |
+ **OrderExpiry** | **DateTime** | | [optional]
+ **Sell** | [**PrepareListingRequestSell**](PrepareListingRequestSell.md) | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareListingRequestBuy.md b/src/Packages/Orderbook/Documentation~/PrepareListingRequestBuy.md
new file mode 100644
index 000000000..416601b30
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareListingRequestBuy.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.PrepareListingRequestBuy
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **ContractAddress** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareListingRequestSell.md b/src/Packages/Orderbook/Documentation~/PrepareListingRequestSell.md
new file mode 100644
index 000000000..2d1b23a00
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareListingRequestSell.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.PrepareListingRequestSell
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------|------------|-------------|-------
+ **Amount** | **string** | |
+ **ContractAddress** | **string** | |
+ **TokenId** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareOrderCancellations200Response.md b/src/Packages/Orderbook/Documentation~/PrepareOrderCancellations200Response.md
new file mode 100644
index 000000000..fcd2431a9
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareOrderCancellations200Response.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.PrepareOrderCancellations200Response
+
+Response schema for the prepareOrderCancellations endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------|-----------------------------------------|-------------|------------
+ **SignableAction** | [**SignableAction**](SignableAction.md) | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/PrepareOrderCancellationsRequest.md b/src/Packages/Orderbook/Documentation~/PrepareOrderCancellationsRequest.md
new file mode 100644
index 000000000..eec0dc239
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/PrepareOrderCancellationsRequest.md
@@ -0,0 +1,10 @@
+# Immutable.Orderbook.Model.PrepareOrderCancellationsRequest
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------|------------------------|-------------|-------
+ **OrderIds** | **List<string>** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/RecordStringTypedDataFieldValueInner.md b/src/Packages/Orderbook/Documentation~/RecordStringTypedDataFieldValueInner.md
new file mode 100644
index 000000000..e5e080bff
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/RecordStringTypedDataFieldValueInner.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.RecordStringTypedDataFieldValueInner
+
+## Properties
+
+ Name | Type | Description | Notes
+----------|------------|-------------|-------
+ **Name** | **string** | |
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/SignableAction.md b/src/Packages/Orderbook/Documentation~/SignableAction.md
new file mode 100644
index 000000000..c6acd6bfd
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/SignableAction.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.SignableAction
+
+## Properties
+
+ Name | Type | Description | Notes
+-------------|-------------------------------------------------------|-------------|------------
+ **Message** | [**SignableActionMessage**](SignableActionMessage.md) | | [optional]
+ **Purpose** | **SignablePurpose** | | [optional]
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/SignableActionMessage.md b/src/Packages/Orderbook/Documentation~/SignableActionMessage.md
new file mode 100644
index 000000000..0c7dd6ab1
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/SignableActionMessage.md
@@ -0,0 +1,13 @@
+# Immutable.Orderbook.Model.SignableActionMessage
+
+## Properties
+
+ Name | Type | Description | Notes
+-----------------|--------------------------------------------------------------------------------|-------------|------------
+ **Domain** | [**TypedDataDomain**](TypedDataDomain.md) | | [optional]
+ **Types** | **Dictionary<string, List<RecordStringTypedDataFieldValueInner>>** | | [optional]
+ **Message** | **Dictionary<string, Object>** | | [optional]
+ **PrimaryType** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/SignablePurpose.md b/src/Packages/Orderbook/Documentation~/SignablePurpose.md
new file mode 100644
index 000000000..6013d0c00
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/SignablePurpose.md
@@ -0,0 +1,9 @@
+# Immutable.Orderbook.Model.SignablePurpose
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TokenBalance200Response.md b/src/Packages/Orderbook/Documentation~/TokenBalance200Response.md
new file mode 100644
index 000000000..d1533f170
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TokenBalance200Response.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.TokenBalance200Response
+
+The response body returned from get balance endpoint
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------|------------|-------------|-------
+ **Quantity** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TransactionAction.md b/src/Packages/Orderbook/Documentation~/TransactionAction.md
new file mode 100644
index 000000000..3b5415b4e
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TransactionAction.md
@@ -0,0 +1,12 @@
+# Immutable.Orderbook.Model.TransactionAction
+
+## Properties
+
+ Name | Type | Description | Notes
+---------------------------|-----------------------------------------------------------------------------------------|-------------|------------
+ **PopulatedTransactions** | [**TransactionActionPopulatedTransactions**](TransactionActionPopulatedTransactions.md) | | [optional]
+ **Purpose** | **TransactionPurpose** | | [optional]
+ **Type** | **string** | |
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactions.md b/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactions.md
new file mode 100644
index 000000000..6b8e811ee
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactions.md
@@ -0,0 +1,23 @@
+# Immutable.Orderbook.Model.TransactionActionPopulatedTransactions
+
+## Properties
+
+ Name | Type | Description | Notes
+--------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-------------|------------
+ **To** | **string** | | [optional]
+ **From** | **string** | | [optional]
+ **Nonce** | **decimal** | | [optional]
+ **GasLimit** | **string** | | [optional]
+ **GasPrice** | **string** | | [optional]
+ **Data** | **string** | | [optional]
+ **Value** | **string** | | [optional]
+ **ChainId** | **decimal** | | [optional]
+ **Type** | **decimal** | | [optional]
+ **AccessList** | [**List<TransactionActionPopulatedTransactionsAccessListInner>**](TransactionActionPopulatedTransactionsAccessListInner.md) | | [optional]
+ **MaxFeePerGas** | **string** | | [optional]
+ **MaxPriorityFeePerGas** | **string** | | [optional]
+ **CustomData** | **Dictionary<string, Object>** | | [optional]
+ **CcipReadEnabled** | **bool** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactionsAccessListInner.md b/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactionsAccessListInner.md
new file mode 100644
index 000000000..381d0b3cf
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TransactionActionPopulatedTransactionsAccessListInner.md
@@ -0,0 +1,11 @@
+# Immutable.Orderbook.Model.TransactionActionPopulatedTransactionsAccessListInner
+
+## Properties
+
+ Name | Type | Description | Notes
+-----------------|------------------------|-------------|------------
+ **Address** | **string** | | [optional]
+ **StorageKeys** | **List<string>** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TransactionPurpose.md b/src/Packages/Orderbook/Documentation~/TransactionPurpose.md
new file mode 100644
index 000000000..4f29cd036
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TransactionPurpose.md
@@ -0,0 +1,9 @@
+# Immutable.Orderbook.Model.TransactionPurpose
+
+## Properties
+
+ Name | Type | Description | Notes
+------|------|-------------|-------
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/Documentation~/TypedDataDomain.md b/src/Packages/Orderbook/Documentation~/TypedDataDomain.md
new file mode 100644
index 000000000..f63823103
--- /dev/null
+++ b/src/Packages/Orderbook/Documentation~/TypedDataDomain.md
@@ -0,0 +1,14 @@
+# Immutable.Orderbook.Model.TypedDataDomain
+
+## Properties
+
+ Name | Type | Description | Notes
+-----------------------|------------|-------------|------------
+ **ChainId** | **string** | | [optional]
+ **Name** | **string** | | [optional]
+ **Salt** | **string** | | [optional]
+ **VerifyingContract** | **string** | | [optional]
+ **VarVersion** | **string** | | [optional]
+
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
diff --git a/src/Packages/Orderbook/LICENSE.md b/src/Packages/Orderbook/LICENSE.md
new file mode 100644
index 000000000..f47af0acd
--- /dev/null
+++ b/src/Packages/Orderbook/LICENSE.md
@@ -0,0 +1,176 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/src/Packages/Orderbook/LICENSE.md.meta b/src/Packages/Orderbook/LICENSE.md.meta
new file mode 100644
index 000000000..960d63310
--- /dev/null
+++ b/src/Packages/Orderbook/LICENSE.md.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 1a766e9246e70406cb571d7be2a7e8f9
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/README.md b/src/Packages/Orderbook/README.md
new file mode 100644
index 000000000..3441f4b89
--- /dev/null
+++ b/src/Packages/Orderbook/README.md
@@ -0,0 +1,177 @@
+# Immutable.Orderbook - the C# library for the TS SDK API
+
+Running TS SDK as an API
+
+This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
+
+- API version: 1.0.0
+- SDK version: 1.0.0
+- Generator version: 7.8.0
+- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
+ For more information, please visit [https://immutable.com](https://immutable.com)
+
+
+
+## Version support
+
+This generator should support all current LTS versions of Unity
+
+- Unity 2020.3 (LTS) and up
+- .NET Standard 2.1 / .NET Framework
+
+
+
+## Dependencies
+
+- [Newtonsoft.Json](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html) - 3.0.2 or
+ later
+- [Unity Test Framework](https://docs.unity3d.com/Packages/com.unity.test-framework@1.1/manual/index.html) - 1.1.33 or
+ later
+
+
+
+## Installation
+
+Add the dependencies to `Packages/manifest.json`
+
+```
+{
+ "dependencies": {
+ ...
+ "com.unity.nuget.newtonsoft-json": "3.0.2",
+ "com.unity.test-framework": "1.1.33",
+ }
+}
+```
+
+Then use the namespaces:
+
+```csharp
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+```
+
+
+
+## Getting Started
+
+```csharp
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using Immutable.Orderbook.Api;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Immutable.OrderbookExample
+{
+
+ public class CancelOrdersExample : MonoBehaviour
+ {
+ async void Start()
+ {
+ Configuration config = new Configuration();
+ config.BasePath = "https://api.immutable.com";
+ var apiInstance = new OrderbookApi(config);
+ var cancelOrdersRequest = new CancelOrdersRequest?(); // CancelOrdersRequest? | (optional)
+
+ try
+ {
+ CancelOrders200Response result = await apiInstance.CancelOrdersAsync(cancelOrdersRequest);
+ Debug.Log(result);
+ Debug.Log("Done!");
+ }
+ catch (ApiException e)
+ {
+ Debug.LogError("Exception when calling OrderbookApi.CancelOrders: " + e.Message );
+ Debug.LogError("Status Code: "+ e.ErrorCode);
+ Debug.LogError(e.StackTrace);
+ }
+
+ }
+ }
+}
+```
+
+
+
+## Documentation for API Endpoints
+
+All URIs are relative to *https://api.immutable.com*
+
+ Class | Method | HTTP request | Description
+----------------|----------------------------------------------------------------------------|---------------------------------------------------------|-------------
+ *OrderbookApi* | [**CancelOrders**](OrderbookApi.md#cancelorders) | **POST** /v1/ts-sdk/orderbook/cancelOrders |
+ *OrderbookApi* | [**CancelOrdersOnChain**](OrderbookApi.md#cancelordersonchain) | **POST** /v1/ts-sdk/orderbook/cancelOrdersOnChain |
+ *OrderbookApi* | [**CreateListing**](OrderbookApi.md#createlisting) | **POST** /v1/ts-sdk/orderbook/createListing |
+ *OrderbookApi* | [**FulfillOrder**](OrderbookApi.md#fulfillorder) | **POST** /v1/ts-sdk/orderbook/fulfillOrder |
+ *OrderbookApi* | [**PrepareListing**](OrderbookApi.md#preparelisting) | **POST** /v1/ts-sdk/orderbook/prepareListing |
+ *OrderbookApi* | [**PrepareOrderCancellations**](OrderbookApi.md#prepareordercancellations) | **POST** /v1/ts-sdk/orderbook/prepareOrderCancellations |
+ *OrderbookApi* | [**TokenBalance**](OrderbookApi.md#tokenbalance) | **GET** /v1/ts-sdk/token/balance |
+
+
+
+## Documentation for Models
+
+- [Model.Action](Action.md)
+- [Model.BigNumberish](BigNumberish.md)
+- [Model.CancelOrders200Response](CancelOrders200Response.md)
+- [Model.CancelOrders200ResponseResult](CancelOrders200ResponseResult.md)
+- [Model.CancelOrders200ResponseResultFailedCancellationsInner](CancelOrders200ResponseResultFailedCancellationsInner.md)
+- [Model.CancelOrdersOnChain200Response](CancelOrdersOnChain200Response.md)
+- [Model.CancelOrdersOnChainRequest](CancelOrdersOnChainRequest.md)
+- [Model.CancelOrdersRequest](CancelOrdersRequest.md)
+- [Model.CancellationType](CancellationType.md)
+- [Model.CancelledOrderStatusCancellationType](CancelledOrderStatusCancellationType.md)
+- [Model.CreateListing200Response](CreateListing200Response.md)
+- [Model.CreateListingRequest](CreateListingRequest.md)
+- [Model.ERC1155Item](ERC1155Item.md)
+- [Model.ERC20Item](ERC20Item.md)
+- [Model.ERC721Item](ERC721Item.md)
+- [Model.Fee](Fee.md)
+- [Model.FeeType](FeeType.md)
+- [Model.FeeValue](FeeValue.md)
+- [Model.FulfillOrder200Response](FulfillOrder200Response.md)
+- [Model.FulfillOrderRequest](FulfillOrderRequest.md)
+- [Model.FulfillOrderRequestTakerFeesInner](FulfillOrderRequestTakerFeesInner.md)
+- [Model.ItemType](ItemType.md)
+- [Model.NativeItem](NativeItem.md)
+- [Model.Order](Order.md)
+- [Model.OrderChain](OrderChain.md)
+- [Model.OrderComponents](OrderComponents.md)
+- [Model.OrderComponentsConsiderationInner](OrderComponentsConsiderationInner.md)
+- [Model.OrderComponentsOfferInner](OrderComponentsOfferInner.md)
+- [Model.OrderFillStatus](OrderFillStatus.md)
+- [Model.OrderProtocolData](OrderProtocolData.md)
+- [Model.OrderStatus](OrderStatus.md)
+- [Model.OrderStatusOneOf](OrderStatusOneOf.md)
+- [Model.OrderStatusOneOf1](OrderStatusOneOf1.md)
+- [Model.OrderStatusOneOf2](OrderStatusOneOf2.md)
+- [Model.OrderStatusOneOf3](OrderStatusOneOf3.md)
+- [Model.OrderStatusOneOf4](OrderStatusOneOf4.md)
+- [Model.OrderStatusOneOf5](OrderStatusOneOf5.md)
+- [Model.OrderType](OrderType.md)
+- [Model.PrepareListing200Response](PrepareListing200Response.md)
+- [Model.PrepareListingRequest](PrepareListingRequest.md)
+- [Model.PrepareListingRequestBuy](PrepareListingRequestBuy.md)
+- [Model.PrepareListingRequestSell](PrepareListingRequestSell.md)
+- [Model.PrepareOrderCancellations200Response](PrepareOrderCancellations200Response.md)
+- [Model.PrepareOrderCancellationsRequest](PrepareOrderCancellationsRequest.md)
+- [Model.RecordStringTypedDataFieldValueInner](RecordStringTypedDataFieldValueInner.md)
+- [Model.SignableAction](SignableAction.md)
+- [Model.SignableActionMessage](SignableActionMessage.md)
+- [Model.SignablePurpose](SignablePurpose.md)
+- [Model.TokenBalance200Response](TokenBalance200Response.md)
+- [Model.TransactionAction](TransactionAction.md)
+- [Model.TransactionActionPopulatedTransactions](TransactionActionPopulatedTransactions.md)
+- [Model.TransactionActionPopulatedTransactionsAccessListInner](TransactionActionPopulatedTransactionsAccessListInner.md)
+- [Model.TransactionPurpose](TransactionPurpose.md)
+- [Model.TypedDataDomain](TypedDataDomain.md)
+
+
+
+## Documentation for Authorization
+
+Endpoints do not require authorization.
+
diff --git a/src/Packages/Orderbook/README.md.meta b/src/Packages/Orderbook/README.md.meta
new file mode 100644
index 000000000..7cd05b370
--- /dev/null
+++ b/src/Packages/Orderbook/README.md.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c799610467326457e9f4247558ddaf77
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime.meta b/src/Packages/Orderbook/Runtime.meta
new file mode 100644
index 000000000..3e657c27e
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8349bcc36cb264391825b8a55c2808dc
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Api.meta b/src/Packages/Orderbook/Runtime/Api.meta
new file mode 100644
index 000000000..c8aa1d313
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Api.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9aaca6b7e8a7a43e2b4534f6dd9c088f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs b/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs
new file mode 100644
index 000000000..b4123fedd
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs
@@ -0,0 +1,1398 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Immutable.Orderbook.Client;
+using Immutable.Orderbook.Model;
+
+namespace Immutable.Orderbook.Api
+{
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IOrderbookApiSync : IApiAccessor
+ {
+ #region Synchronous Operations
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CancelOrders200Response
+ CancelOrders200Response CancelOrders(CancelOrdersRequest? cancelOrdersRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CancelOrders200Response
+ ApiResponse CancelOrdersWithHttpInfo(
+ CancelOrdersRequest? cancelOrdersRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CancelOrdersOnChain200Response
+ CancelOrdersOnChain200Response CancelOrdersOnChain(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CancelOrdersOnChain200Response
+ ApiResponse CancelOrdersOnChainWithHttpInfo(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CreateListing200Response
+ CreateListing200Response CreateListing(CreateListingRequest? createListingRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CreateListing200Response
+ ApiResponse CreateListingWithHttpInfo(
+ CreateListingRequest? createListingRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// FulfillOrder200Response
+ FulfillOrder200Response FulfillOrder(FulfillOrderRequest? fulfillOrderRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of FulfillOrder200Response
+ ApiResponse FulfillOrderWithHttpInfo(
+ FulfillOrderRequest? fulfillOrderRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// PrepareListing200Response
+ PrepareListing200Response PrepareListing(PrepareListingRequest? prepareListingRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of PrepareListing200Response
+ ApiResponse PrepareListingWithHttpInfo(
+ PrepareListingRequest? prepareListingRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// PrepareOrderCancellations200Response
+ PrepareOrderCancellations200Response PrepareOrderCancellations(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of PrepareOrderCancellations200Response
+ ApiResponse PrepareOrderCancellationsWithHttpInfo(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default);
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// TokenBalance200Response
+ TokenBalance200Response TokenBalance(string walletAddress, string contractAddress);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// ApiResponse of TokenBalance200Response
+ ApiResponse TokenBalanceWithHttpInfo(string walletAddress, string contractAddress);
+
+ #endregion Synchronous Operations
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IOrderbookApiAsync : IApiAccessor
+ {
+ #region Asynchronous Operations
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CancelOrders200Response
+ Task CancelOrdersAsync(CancelOrdersRequest? cancelOrdersRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CancelOrders200Response)
+ Task> CancelOrdersWithHttpInfoAsync(
+ CancelOrdersRequest? cancelOrdersRequest = default, CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CancelOrdersOnChain200Response
+ Task CancelOrdersOnChainAsync(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CancelOrdersOnChain200Response)
+ Task> CancelOrdersOnChainWithHttpInfoAsync(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CreateListing200Response
+ Task CreateListingAsync(CreateListingRequest? createListingRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CreateListing200Response)
+ Task> CreateListingWithHttpInfoAsync(
+ CreateListingRequest? createListingRequest = default, CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of FulfillOrder200Response
+ Task FulfillOrderAsync(FulfillOrderRequest? fulfillOrderRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (FulfillOrder200Response)
+ Task> FulfillOrderWithHttpInfoAsync(
+ FulfillOrderRequest? fulfillOrderRequest = default, CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of PrepareListing200Response
+ Task PrepareListingAsync(PrepareListingRequest? prepareListingRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (PrepareListing200Response)
+ Task> PrepareListingWithHttpInfoAsync(
+ PrepareListingRequest? prepareListingRequest = default, CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of PrepareOrderCancellations200Response
+ Task PrepareOrderCancellationsAsync(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (PrepareOrderCancellations200Response)
+ Task> PrepareOrderCancellationsWithHttpInfoAsync(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// Cancellation Token to cancel the request.
+ /// Task of TokenBalance200Response
+ Task TokenBalanceAsync(string walletAddress, string contractAddress,
+ CancellationToken cancellationToken = default);
+
+ ///
+ ///
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (TokenBalance200Response)
+ Task> TokenBalanceWithHttpInfoAsync(string walletAddress,
+ string contractAddress, CancellationToken cancellationToken = default);
+
+ #endregion Asynchronous Operations
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public interface IOrderbookApi : IOrderbookApiSync, IOrderbookApiAsync
+ {
+ }
+
+ ///
+ /// Represents a collection of functions to interact with the API endpoints
+ ///
+ public class OrderbookApi : IDisposable, IOrderbookApi
+ {
+ private ExceptionFactory _exceptionFactory = (name, response) => null;
+
+ ///
+ /// Initializes a new instance of the class.
+ /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
+ /// It's better to reuse the
+ ///
+ /// HttpClient
+ /// and HttpClientHandler
+ ///
+ /// .
+ ///
+ ///
+ public OrderbookApi() : this((string)null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
+ /// It's better to reuse the
+ ///
+ /// HttpClient
+ /// and HttpClientHandler
+ ///
+ /// .
+ ///
+ /// The target service's base path in URL format.
+ ///
+ ///
+ public OrderbookApi(string basePath)
+ {
+ Configuration = Orderbook.Client.Configuration.MergeConfigurations(
+ GlobalConfiguration.Instance,
+ new Configuration { BasePath = basePath }
+ );
+ ApiClient = new ApiClient(Configuration.BasePath);
+ Client = ApiClient;
+ AsynchronousClient = ApiClient;
+ ExceptionFactory = Orderbook.Client.Configuration.DefaultExceptionFactory;
+ }
+
+ ///
+ /// Initializes a new instance of the class using Configuration object.
+ /// **IMPORTANT** This will also create an instance of HttpClient, which is less than ideal.
+ /// It's better to reuse the
+ ///
+ /// HttpClient
+ /// and HttpClientHandler
+ ///
+ /// .
+ ///
+ /// An instance of Configuration.
+ ///
+ ///
+ public OrderbookApi(Configuration configuration)
+ {
+ if (configuration == null) throw new ArgumentNullException("configuration");
+
+ Configuration = Orderbook.Client.Configuration.MergeConfigurations(
+ GlobalConfiguration.Instance,
+ configuration
+ );
+ ApiClient = new ApiClient(Configuration.BasePath);
+ Client = ApiClient;
+ AsynchronousClient = ApiClient;
+ ExceptionFactory = Orderbook.Client.Configuration.DefaultExceptionFactory;
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// using a Configuration object and client instance.
+ ///
+ /// The client interface for synchronous API access.
+ /// The client interface for asynchronous API access.
+ /// The configuration object.
+ ///
+ public OrderbookApi(ISynchronousClient client, IAsynchronousClient asyncClient,
+ IReadableConfiguration configuration)
+ {
+ if (client == null) throw new ArgumentNullException("client");
+ if (asyncClient == null) throw new ArgumentNullException("asyncClient");
+ if (configuration == null) throw new ArgumentNullException("configuration");
+
+ Client = client;
+ AsynchronousClient = asyncClient;
+ Configuration = configuration;
+ ExceptionFactory = Orderbook.Client.Configuration.DefaultExceptionFactory;
+ }
+
+ ///
+ /// Holds the ApiClient if created
+ ///
+ public ApiClient ApiClient { get; set; }
+
+ ///
+ /// The client for accessing this underlying API asynchronously.
+ ///
+ public IAsynchronousClient AsynchronousClient { get; set; }
+
+ ///
+ /// The client for accessing this underlying API synchronously.
+ ///
+ public ISynchronousClient Client { get; set; }
+
+ ///
+ /// Disposes resources if they were created by us
+ ///
+ public void Dispose()
+ {
+ ApiClient?.Dispose();
+ }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ public string GetBasePath()
+ {
+ return Configuration.BasePath;
+ }
+
+ ///
+ /// Gets or sets the configuration object
+ ///
+ /// An instance of the Configuration
+ public IReadableConfiguration Configuration { get; set; }
+
+ ///
+ /// Provides a factory method hook for the creation of exceptions.
+ ///
+ public ExceptionFactory ExceptionFactory
+ {
+ get
+ {
+ if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
+ throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
+ return _exceptionFactory;
+ }
+ set => _exceptionFactory = value;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CancelOrders200Response
+ public CancelOrders200Response CancelOrders(CancelOrdersRequest? cancelOrdersRequest = default)
+ {
+ var localVarResponse = CancelOrdersWithHttpInfo(cancelOrdersRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CancelOrders200Response
+ public ApiResponse CancelOrdersWithHttpInfo(
+ CancelOrdersRequest? cancelOrdersRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = cancelOrdersRequest;
+
+
+ // make the HTTP request
+ var localVarResponse = Client.Post("/v1/ts-sdk/orderbook/cancelOrders",
+ localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CancelOrders", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CancelOrders200Response
+ public async Task CancelOrdersAsync(CancelOrdersRequest? cancelOrdersRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var task = CancelOrdersWithHttpInfoAsync(cancelOrdersRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CancelOrders200Response)
+ public async Task> CancelOrdersWithHttpInfoAsync(
+ CancelOrdersRequest? cancelOrdersRequest = default, CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = cancelOrdersRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync("/v1/ts-sdk/orderbook/cancelOrders",
+ localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CancelOrders", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CancelOrdersOnChain200Response
+ public CancelOrdersOnChain200Response CancelOrdersOnChain(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default)
+ {
+ var localVarResponse = CancelOrdersOnChainWithHttpInfo(cancelOrdersOnChainRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CancelOrdersOnChain200Response
+ public ApiResponse CancelOrdersOnChainWithHttpInfo(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = cancelOrdersOnChainRequest;
+
+
+ // make the HTTP request
+ var localVarResponse =
+ Client.Post("/v1/ts-sdk/orderbook/cancelOrdersOnChain",
+ localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CancelOrdersOnChain", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CancelOrdersOnChain200Response
+ public async Task CancelOrdersOnChainAsync(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var task = CancelOrdersOnChainWithHttpInfoAsync(cancelOrdersOnChainRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CancelOrdersOnChain200Response)
+ public async Task> CancelOrdersOnChainWithHttpInfoAsync(
+ CancelOrdersOnChainRequest? cancelOrdersOnChainRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = cancelOrdersOnChainRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync(
+ "/v1/ts-sdk/orderbook/cancelOrdersOnChain", localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CancelOrdersOnChain", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// CreateListing200Response
+ public CreateListing200Response CreateListing(CreateListingRequest? createListingRequest = default)
+ {
+ var localVarResponse = CreateListingWithHttpInfo(createListingRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of CreateListing200Response
+ public ApiResponse CreateListingWithHttpInfo(
+ CreateListingRequest? createListingRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = createListingRequest;
+
+
+ // make the HTTP request
+ var localVarResponse = Client.Post("/v1/ts-sdk/orderbook/createListing",
+ localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CreateListing", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of CreateListing200Response
+ public async Task CreateListingAsync(
+ CreateListingRequest? createListingRequest = default, CancellationToken cancellationToken = default)
+ {
+ var task = CreateListingWithHttpInfoAsync(createListingRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (CreateListing200Response)
+ public async Task> CreateListingWithHttpInfoAsync(
+ CreateListingRequest? createListingRequest = default, CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = createListingRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync("/v1/ts-sdk/orderbook/createListing",
+ localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("CreateListing", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// FulfillOrder200Response
+ public FulfillOrder200Response FulfillOrder(FulfillOrderRequest? fulfillOrderRequest = default)
+ {
+ var localVarResponse = FulfillOrderWithHttpInfo(fulfillOrderRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of FulfillOrder200Response
+ public ApiResponse FulfillOrderWithHttpInfo(
+ FulfillOrderRequest? fulfillOrderRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = fulfillOrderRequest;
+
+
+ // make the HTTP request
+ var localVarResponse = Client.Post("/v1/ts-sdk/orderbook/fulfillOrder",
+ localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("FulfillOrder", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of FulfillOrder200Response
+ public async Task FulfillOrderAsync(FulfillOrderRequest? fulfillOrderRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var task = FulfillOrderWithHttpInfoAsync(fulfillOrderRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (FulfillOrder200Response)
+ public async Task> FulfillOrderWithHttpInfoAsync(
+ FulfillOrderRequest? fulfillOrderRequest = default, CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = fulfillOrderRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync("/v1/ts-sdk/orderbook/fulfillOrder",
+ localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("FulfillOrder", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// PrepareListing200Response
+ public PrepareListing200Response PrepareListing(PrepareListingRequest? prepareListingRequest = default)
+ {
+ var localVarResponse = PrepareListingWithHttpInfo(prepareListingRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of PrepareListing200Response
+ public ApiResponse PrepareListingWithHttpInfo(
+ PrepareListingRequest? prepareListingRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = prepareListingRequest;
+
+
+ // make the HTTP request
+ var localVarResponse = Client.Post("/v1/ts-sdk/orderbook/prepareListing",
+ localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("PrepareListing", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of PrepareListing200Response
+ public async Task PrepareListingAsync(
+ PrepareListingRequest? prepareListingRequest = default, CancellationToken cancellationToken = default)
+ {
+ var task = PrepareListingWithHttpInfoAsync(prepareListingRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (PrepareListing200Response)
+ public async Task> PrepareListingWithHttpInfoAsync(
+ PrepareListingRequest? prepareListingRequest = default, CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = prepareListingRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync("/v1/ts-sdk/orderbook/prepareListing",
+ localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("PrepareListing", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// PrepareOrderCancellations200Response
+ public PrepareOrderCancellations200Response PrepareOrderCancellations(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default)
+ {
+ var localVarResponse = PrepareOrderCancellationsWithHttpInfo(prepareOrderCancellationsRequest);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// ApiResponse of PrepareOrderCancellations200Response
+ public ApiResponse PrepareOrderCancellationsWithHttpInfo(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = prepareOrderCancellationsRequest;
+
+
+ // make the HTTP request
+ var localVarResponse = Client.Post(
+ "/v1/ts-sdk/orderbook/prepareOrderCancellations", localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("PrepareOrderCancellations", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of PrepareOrderCancellations200Response
+ public async Task PrepareOrderCancellationsAsync(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var task = PrepareOrderCancellationsWithHttpInfoAsync(prepareOrderCancellationsRequest, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ /// (optional)
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (PrepareOrderCancellations200Response)
+ public async Task> PrepareOrderCancellationsWithHttpInfoAsync(
+ PrepareOrderCancellationsRequest? prepareOrderCancellationsRequest = default,
+ CancellationToken cancellationToken = default)
+ {
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ "application/json"
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.Data = prepareOrderCancellationsRequest;
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.PostAsync(
+ "/v1/ts-sdk/orderbook/prepareOrderCancellations", localVarRequestOptions, Configuration,
+ cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("PrepareOrderCancellations", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// TokenBalance200Response
+ public TokenBalance200Response TokenBalance(string walletAddress, string contractAddress)
+ {
+ var localVarResponse = TokenBalanceWithHttpInfo(walletAddress, contractAddress);
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// ApiResponse of TokenBalance200Response
+ public ApiResponse TokenBalanceWithHttpInfo(string walletAddress,
+ string contractAddress)
+ {
+ // verify the required parameter 'walletAddress' is set
+ if (walletAddress == null)
+ throw new ApiException(400,
+ "Missing required parameter 'walletAddress' when calling OrderbookApi->TokenBalance");
+
+ // verify the required parameter 'contractAddress' is set
+ if (contractAddress == null)
+ throw new ApiException(400,
+ "Missing required parameter 'contractAddress' when calling OrderbookApi->TokenBalance");
+
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.QueryParameters.Add(
+ ClientUtils.ParameterToMultiMap("", "wallet_address", walletAddress));
+ localVarRequestOptions.QueryParameters.Add(
+ ClientUtils.ParameterToMultiMap("", "contract_address", contractAddress));
+
+
+ // make the HTTP request
+ var localVarResponse =
+ Client.Get("/v1/ts-sdk/token/balance", localVarRequestOptions, Configuration);
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("TokenBalance", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// Cancellation Token to cancel the request.
+ /// Task of TokenBalance200Response
+ public async Task TokenBalanceAsync(string walletAddress, string contractAddress,
+ CancellationToken cancellationToken = default)
+ {
+ var task = TokenBalanceWithHttpInfoAsync(walletAddress, contractAddress, cancellationToken);
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ Immutable.Orderbook.Client.ApiResponse localVarResponse = await task;
+#endif
+ return localVarResponse.Data;
+ }
+
+ ///
+ ///
+ /// Thrown when fails to make API call
+ ///
+ ///
+ /// Cancellation Token to cancel the request.
+ /// Task of ApiResponse (TokenBalance200Response)
+ public async Task> TokenBalanceWithHttpInfoAsync(string walletAddress,
+ string contractAddress, CancellationToken cancellationToken = default)
+ {
+ // verify the required parameter 'walletAddress' is set
+ if (walletAddress == null)
+ throw new ApiException(400,
+ "Missing required parameter 'walletAddress' when calling OrderbookApi->TokenBalance");
+
+ // verify the required parameter 'contractAddress' is set
+ if (contractAddress == null)
+ throw new ApiException(400,
+ "Missing required parameter 'contractAddress' when calling OrderbookApi->TokenBalance");
+
+
+ var localVarRequestOptions = new RequestOptions();
+
+ string[] _contentTypes =
+ {
+ };
+
+ // to determine the Accept header
+ string[] _accepts =
+ {
+ "application/json"
+ };
+
+
+ var localVarContentType = ClientUtils.SelectHeaderContentType(_contentTypes);
+ if (localVarContentType != null)
+ localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
+
+ var localVarAccept = ClientUtils.SelectHeaderAccept(_accepts);
+ if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
+
+ localVarRequestOptions.QueryParameters.Add(
+ ClientUtils.ParameterToMultiMap("", "wallet_address", walletAddress));
+ localVarRequestOptions.QueryParameters.Add(
+ ClientUtils.ParameterToMultiMap("", "contract_address", contractAddress));
+
+
+ // make the HTTP request
+
+ var task = AsynchronousClient.GetAsync("/v1/ts-sdk/token/balance",
+ localVarRequestOptions, Configuration, cancellationToken);
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ var localVarResponse = await task.ConfigureAwait(false);
+#else
+ var localVarResponse = await task;
+#endif
+
+ if (ExceptionFactory != null)
+ {
+ var _exception = ExceptionFactory("TokenBalance", localVarResponse);
+ if (_exception != null) throw _exception;
+ }
+
+ return localVarResponse;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs.meta b/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs.meta
new file mode 100644
index 000000000..828956bc8
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Api/OrderbookApi.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 649e021e0803d479c8f707137c45adee
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client.meta b/src/Packages/Orderbook/Runtime/Client.meta
new file mode 100644
index 000000000..8216a1635
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 1e2256aef3ab34bb4a5bf7769f9658c0
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiClient.cs b/src/Packages/Orderbook/Runtime/Client/ApiClient.cs
new file mode 100644
index 000000000..9540a3d48
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiClient.cs
@@ -0,0 +1,629 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Threading;
+using System.Threading.Tasks;
+using Immutable.Orderbook.Model;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+using UnityEngine;
+using UnityEngine.Networking;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// To Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
+ ///
+ internal class CustomJsonCodec
+ {
+ private static readonly string _contentType = "application/json";
+ private readonly IReadableConfiguration _configuration;
+
+ private readonly JsonSerializerSettings _serializerSettings = new()
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ public CustomJsonCodec(IReadableConfiguration configuration)
+ {
+ _configuration = configuration;
+ }
+
+ public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
+ {
+ _serializerSettings = serializerSettings;
+ _configuration = configuration;
+ }
+
+ public string RootElement { get; set; }
+ public string Namespace { get; set; }
+ public string DateFormat { get; set; }
+
+ public string ContentType
+ {
+ get => _contentType;
+ set => throw new InvalidOperationException("Not allowed to set content type.");
+ }
+
+ ///
+ /// Serialize the object into a JSON string.
+ ///
+ /// Object to be serialized.
+ /// A JSON string.
+ public string Serialize(object obj)
+ {
+ if (obj != null && obj is AbstractOpenAPISchema)
+ // the object to be serialized is an oneOf/anyOf schema
+ return ((AbstractOpenAPISchema)obj).ToJson();
+ return JsonConvert.SerializeObject(obj, _serializerSettings);
+ }
+
+ public T Deserialize(UnityWebRequest request)
+ {
+ var result = (T)Deserialize(request, typeof(T));
+ return result;
+ }
+
+ ///
+ /// Deserialize the JSON string into a proper object.
+ ///
+ /// The UnityWebRequest after it has a response.
+ /// Object type.
+ /// Object representation of the JSON string.
+ internal object Deserialize(UnityWebRequest request, Type type)
+ {
+ if (type == typeof(byte[])) // return byte array
+ return request.downloadHandler.data;
+
+ // TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
+ if (type == typeof(Stream))
+ // NOTE: Ignoring Content-Disposition filename support, since not all platforms
+ // have a location on disk to write arbitrary data (tvOS, consoles).
+ return new MemoryStream(request.downloadHandler.data);
+
+ if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
+ return DateTime.Parse(request.downloadHandler.text, null, DateTimeStyles.RoundtripKind);
+
+ if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
+ return Convert.ChangeType(request.downloadHandler.text, type);
+
+ var contentType = request.GetResponseHeader("Content-Type");
+
+ if (!string.IsNullOrEmpty(contentType) && contentType.Contains("application/json"))
+ {
+ var text = request.downloadHandler?.text;
+
+ // Generated APIs that don't expect a return value provide System.Object as the type
+ if (type == typeof(object) && (string.IsNullOrEmpty(text) || text.Trim() == "null")) return null;
+
+ if (request.responseCode >= 200 && request.responseCode < 300)
+ try
+ {
+ // Deserialize as a model
+ return JsonConvert.DeserializeObject(text, type, _serializerSettings);
+ }
+ catch (Exception e)
+ {
+ throw new UnexpectedResponseException(request, type, e.ToString());
+ }
+
+ throw new ApiException((int)request.responseCode, request.error, text);
+ }
+
+ if (type != typeof(object) && request.responseCode >= 200 && request.responseCode < 300)
+ throw new UnexpectedResponseException(request, type);
+
+ return null;
+ }
+ }
+
+ ///
+ /// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
+ /// encapsulating general REST accessor use cases.
+ ///
+ ///
+ /// The Dispose method will manage the HttpClient lifecycle when not passed by constructor.
+ ///
+ public partial class ApiClient : IDisposable, ISynchronousClient, IAsynchronousClient
+ {
+ private readonly string _baseUrl;
+
+ ///
+ /// Initializes a new instance of the , defaulting to the global configurations' base url.
+ ///
+ public ApiClient() :
+ this(GlobalConfiguration.Instance.BasePath)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the .
+ ///
+ /// The target service's base path in URL format.
+ ///
+ public ApiClient(string basePath)
+ {
+ if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty");
+
+ _baseUrl = basePath;
+ }
+
+ ///
+ /// Specifies the settings on a object.
+ /// These settings can be adjusted to accommodate custom serialization rules.
+ ///
+ public JsonSerializerSettings SerializerSettings { get; set; } = new()
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ ///
+ /// Disposes resources if they were created by us
+ ///
+ public void Dispose()
+ {
+ }
+
+ ///
+ /// Provides all logic for constructing a new UnityWebRequest.
+ /// At this point, all information for querying the service is known. Here, it is simply
+ /// mapped into the UnityWebRequest.
+ ///
+ /// The http verb.
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// [private] A new UnityWebRequest instance.
+ ///
+ private UnityWebRequest NewRequest(
+ string method,
+ string path,
+ RequestOptions options,
+ IReadableConfiguration configuration)
+ {
+ if (path == null) throw new ArgumentNullException("path");
+ if (options == null) throw new ArgumentNullException("options");
+ if (configuration == null) throw new ArgumentNullException("configuration");
+
+ var builder = new WebRequestPathBuilder(_baseUrl, path);
+
+ builder.AddPathParameters(options.PathParameters);
+
+ builder.AddQueryParameters(options.QueryParameters);
+
+ string contentType = null;
+ if (options.HeaderParameters != null && options.HeaderParameters.ContainsKey("Content-Type"))
+ {
+ var contentTypes = options.HeaderParameters["Content-Type"];
+ contentType = contentTypes.FirstOrDefault();
+ }
+
+ var uri = builder.GetFullUri();
+ UnityWebRequest request = null;
+
+ if (contentType == "multipart/form-data")
+ {
+ var formData = new List();
+ foreach (var formParameter in options.FormParameters)
+ formData.Add(new MultipartFormDataSection(formParameter.Key, formParameter.Value));
+
+ request = UnityWebRequest.Post(uri, formData);
+ request.method = method;
+ }
+ else if (contentType == "application/x-www-form-urlencoded")
+ {
+ var form = new WWWForm();
+ foreach (var kvp in options.FormParameters) form.AddField(kvp.Key, kvp.Value);
+
+ request = UnityWebRequest.Post(uri, form);
+ request.method = method;
+ }
+ else if (options.Data != null)
+ {
+ var serializer = new CustomJsonCodec(SerializerSettings, configuration);
+ var jsonData = serializer.Serialize(options.Data);
+
+ // Making a post body application/json encoded is whack with UnityWebRequest.
+ // See: https://stackoverflow.com/questions/68156230/unitywebrequest-post-not-sending-body
+ request = UnityWebRequest.Put(uri, jsonData);
+ request.method = method;
+ request.SetRequestHeader("Content-Type", "application/json");
+ }
+ else
+ {
+ request = new UnityWebRequest(builder.GetFullUri(), method);
+ }
+
+ if (request.downloadHandler == null && typeof(T) != typeof(object))
+ request.downloadHandler = new DownloadHandlerBuffer();
+
+#if UNITY_EDITOR || !UNITY_WEBGL
+ if (configuration.UserAgent != null) request.SetRequestHeader("User-Agent", configuration.UserAgent);
+#endif
+
+ if (configuration.DefaultHeaders != null)
+ foreach (var headerParam in configuration.DefaultHeaders)
+ request.SetRequestHeader(headerParam.Key, headerParam.Value);
+
+ if (options.HeaderParameters != null)
+ foreach (var headerParam in options.HeaderParameters)
+ foreach (var value in headerParam.Value)
+ // Todo make content headers actually content headers
+ request.SetRequestHeader(headerParam.Key, value);
+
+ if (options.Cookies != null && options.Cookies.Count > 0)
+ {
+#if UNITY_WEBGL
+ throw new System.InvalidOperationException("UnityWebRequest does not support setting cookies in WebGL");
+#else
+ if (options.Cookies.Count != 1) Debug.LogError("Only one cookie supported, ignoring others");
+
+ request.SetRequestHeader("Cookie", options.Cookies[0].ToString());
+#endif
+ }
+
+ return request;
+ }
+
+ partial void InterceptRequest(UnityWebRequest req, string path, RequestOptions options,
+ IReadableConfiguration configuration);
+
+ partial void InterceptResponse(UnityWebRequest req, string path, RequestOptions options,
+ IReadableConfiguration configuration, ref object responseData);
+
+ private ApiResponse ToApiResponse(UnityWebRequest request, object responseData)
+ {
+ var result = (T)responseData;
+
+ var transformed = new ApiResponse((HttpStatusCode)request.responseCode, new Multimap(),
+ result, request.downloadHandler?.text ?? "")
+ {
+ ErrorText = request.error,
+ Cookies = new List()
+ };
+
+ // process response headers, e.g. Access-Control-Allow-Methods
+ var responseHeaders = request.GetResponseHeaders();
+ if (responseHeaders != null)
+ foreach (var responseHeader in request.GetResponseHeaders())
+ transformed.Headers.Add(responseHeader.Key, ClientUtils.ParameterToString(responseHeader.Value));
+
+ return transformed;
+ }
+
+ private async Task> ExecAsync(
+ UnityWebRequest request,
+ string path,
+ RequestOptions options,
+ IReadableConfiguration configuration,
+ CancellationToken cancellationToken = default)
+ {
+ var deserializer = new CustomJsonCodec(SerializerSettings, configuration);
+
+ using (request)
+ {
+ if (configuration.Timeout > 0) request.timeout = (int)Math.Ceiling(configuration.Timeout / 1000.0f);
+
+ if (configuration.Proxy != null)
+ throw new InvalidOperationException("Configuration `Proxy` not supported by UnityWebRequest");
+
+ if (configuration.ClientCertificates != null)
+ // Only Android/iOS/tvOS/Standalone players can support certificates, and this
+ // implementation is intended to work on all platforms.
+ //
+ // TODO: Could optionally allow support for this on these platforms.
+ //
+ // See: https://docs.unity3d.com/ScriptReference/Networking.CertificateHandler.html
+ throw new InvalidOperationException(
+ "Configuration `ClientCertificates` not supported by UnityWebRequest on all platforms");
+
+ InterceptRequest(request, path, options, configuration);
+
+ var asyncOp = request.SendWebRequest();
+
+ var tsc = new TaskCompletionSource();
+ asyncOp.completed += _ => tsc.TrySetResult(request.result);
+
+ using (var tokenRegistration = cancellationToken.Register(request.Abort, true))
+ {
+ await tsc.Task;
+ }
+
+ if (request.result == UnityWebRequest.Result.ConnectionError ||
+ request.result == UnityWebRequest.Result.DataProcessingError)
+ throw new ConnectionException(request);
+
+ object responseData = deserializer.Deserialize(request);
+
+ // if the response type is oneOf/anyOf, call FromJSON to deserialize the data
+ if (typeof(AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
+ responseData = (T)typeof(T).GetMethod("FromJson").Invoke(null,
+ new object[] { new ByteArrayContent(request.downloadHandler.data) });
+ else if (typeof(T).Name == "Stream") // for binary response
+ responseData = (T)(object)new MemoryStream(request.downloadHandler.data);
+
+ InterceptResponse(request, path, options, configuration, ref responseData);
+
+ return ToApiResponse(request, responseData);
+ }
+ }
+
+ #region IAsynchronousClient
+
+ ///
+ /// Make a HTTP GET request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> GetAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("GET", path, options, config), path, options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP POST request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PostAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("POST", path, options, config), path, options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP PUT request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PutAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("PUT", path, options, config), path, options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP DELETE request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> DeleteAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("DELETE", path, options, config), path, options, config,
+ cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP HEAD request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> HeadAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("HEAD", path, options, config), path, options, config, cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP OPTION request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> OptionsAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("OPTIONS", path, options, config), path, options, config,
+ cancellationToken);
+ }
+
+ ///
+ /// Make a HTTP PATCH request (async).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// Token that enables callers to cancel the request.
+ /// A Task containing ApiResponse
+ public Task> PatchAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default)
+ {
+ var config = configuration ?? GlobalConfiguration.Instance;
+ return ExecAsync(NewRequest("PATCH", path, options, config), path, options, config,
+ cancellationToken);
+ }
+
+ #endregion IAsynchronousClient
+
+ #region ISynchronousClient
+
+ ///
+ /// Make a HTTP GET request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP POST request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP PUT request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP DELETE request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Delete(string path, RequestOptions options,
+ IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP HEAD request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP OPTION request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Options(string path, RequestOptions options,
+ IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ ///
+ /// Make a HTTP PATCH request (synchronous).
+ ///
+ /// The target path (or resource).
+ /// The additional request options.
+ ///
+ /// A per-request configuration object. It is assumed that any merge with
+ /// GlobalConfiguration has been done before calling this method.
+ ///
+ /// A Task containing ApiResponse
+ public ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null)
+ {
+ throw new NotImplementedException("UnityWebRequest does not support synchronous operation");
+ }
+
+ #endregion ISynchronousClient
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiClient.cs.meta b/src/Packages/Orderbook/Runtime/Client/ApiClient.cs.meta
new file mode 100644
index 000000000..e6faeb122
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiClient.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 922092e9e7ab24e0c8abf6095b93ea27
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiException.cs b/src/Packages/Orderbook/Runtime/Client/ApiException.cs
new file mode 100644
index 000000000..a801c57ce
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiException.cs
@@ -0,0 +1,71 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// API Exception
+ ///
+ public class ApiException : Exception
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ApiException()
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Error message.
+ public ApiException(int errorCode, string message) : base(message)
+ {
+ ErrorCode = errorCode;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Error message.
+ /// Error content.
+ /// HTTP Headers.
+ public ApiException(int errorCode, string message, object errorContent = null,
+ Multimap headers = null) : base(message)
+ {
+ ErrorCode = errorCode;
+ ErrorContent = errorContent;
+ Headers = headers;
+ }
+
+ ///
+ /// Gets or sets the error code (HTTP status code)
+ ///
+ /// The error code (HTTP status code).
+ public int ErrorCode { get; set; }
+
+ ///
+ /// Gets or sets the error content (body json object)
+ ///
+ /// The error content (Http response body).
+ public object ErrorContent { get; private set; }
+
+ ///
+ /// Gets or sets the HTTP headers
+ ///
+ /// HTTP headers
+ public Multimap Headers { get; private set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiException.cs.meta b/src/Packages/Orderbook/Runtime/Client/ApiException.cs.meta
new file mode 100644
index 000000000..5f4206fbb
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiException.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 57b24194e467b4728b63ea0b4f2771e6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs b/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs
new file mode 100644
index 000000000..79389650a
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs
@@ -0,0 +1,163 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Net;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Provides a non-generic contract for the ApiResponse wrapper.
+ ///
+ public interface IApiResponse
+ {
+ ///
+ /// The data type of
+ ///
+ Type ResponseType { get; }
+
+ ///
+ /// The content of this response
+ ///
+ object Content { get; }
+
+ ///
+ /// Gets or sets the status code (HTTP status code)
+ ///
+ /// The status code.
+ HttpStatusCode StatusCode { get; }
+
+ ///
+ /// Gets or sets the HTTP headers
+ ///
+ /// HTTP headers
+ Multimap Headers { get; }
+
+ ///
+ /// Gets or sets any error text defined by the calling client.
+ ///
+ string ErrorText { get; set; }
+
+ ///
+ /// Gets or sets any cookies passed along on the response.
+ ///
+ List Cookies { get; set; }
+
+ ///
+ /// The raw content of this response
+ ///
+ string RawContent { get; }
+ }
+
+ ///
+ /// API Response
+ ///
+ public class ApiResponse : IApiResponse
+ {
+ #region Properties
+
+ ///
+ /// Gets or sets the status code (HTTP status code)
+ ///
+ /// The status code.
+ public HttpStatusCode StatusCode { get; }
+
+ ///
+ /// Gets or sets the HTTP headers
+ ///
+ /// HTTP headers
+ public Multimap Headers { get; }
+
+ ///
+ /// Gets or sets the data (parsed HTTP body)
+ ///
+ /// The data.
+ public T Data { get; }
+
+ ///
+ /// Gets or sets any error text defined by the calling client.
+ ///
+ public string ErrorText { get; set; }
+
+ ///
+ /// Gets or sets any cookies passed along on the response.
+ ///
+ public List Cookies { get; set; }
+
+ ///
+ /// The content of this response
+ ///
+ public Type ResponseType => typeof(T);
+
+ ///
+ /// The data type of
+ ///
+ public object Content => Data;
+
+ ///
+ /// The raw content
+ ///
+ public string RawContent { get; }
+
+ #endregion Properties
+
+ #region Constructors
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// HTTP headers.
+ /// Data (parsed HTTP body)
+ /// Raw content.
+ public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data, string rawContent)
+ {
+ StatusCode = statusCode;
+ Headers = headers;
+ Data = data;
+ RawContent = rawContent;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// HTTP headers.
+ /// Data (parsed HTTP body)
+ public ApiResponse(HttpStatusCode statusCode, Multimap headers, T data) : this(statusCode,
+ headers, data, null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Data (parsed HTTP body)
+ /// Raw content.
+ public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data,
+ rawContent)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// HTTP status code.
+ /// Data (parsed HTTP body)
+ public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null)
+ {
+ }
+
+ #endregion Constructors
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs.meta b/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs.meta
new file mode 100644
index 000000000..512d6e7fd
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ApiResponse.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 50c50b7eccd4546d6b19b58b0eaff32f
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs b/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs
new file mode 100644
index 000000000..219d99221
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs
@@ -0,0 +1,240 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Runtime.Serialization;
+using System.Text;
+using System.Text.RegularExpressions;
+using Newtonsoft.Json;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Utility functions providing some benefit to API client consumers.
+ ///
+ public static class ClientUtils
+ {
+ ///
+ /// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
+ ///
+ public static readonly Regex JsonRegex = new("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
+
+ ///
+ /// Sanitize filename by removing the path
+ ///
+ /// Filename
+ /// Filename
+ public static string SanitizeFilename(string filename)
+ {
+ var match = Regex.Match(filename, @".*[/\\](.*)$");
+ return match.Success ? match.Groups[1].Value : filename;
+ }
+
+ ///
+ /// Convert params to key/value pairs.
+ /// Use collectionFormat to properly format lists and collections.
+ ///
+ /// The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi
+ /// Key name.
+ /// Value object.
+ /// A multimap of keys with 1..n associated values.
+ public static Multimap ParameterToMultiMap(string collectionFormat, string name, object value)
+ {
+ var parameters = new Multimap();
+
+ if (value is ICollection collection && collectionFormat == "multi")
+ {
+ foreach (var item in collection) parameters.Add(name, ParameterToString(item));
+ }
+ else if (value is IDictionary dictionary)
+ {
+ if (collectionFormat == "deepObject")
+ foreach (DictionaryEntry entry in dictionary)
+ parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value));
+ else
+ foreach (DictionaryEntry entry in dictionary)
+ parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value));
+ }
+ else
+ {
+ parameters.Add(name, ParameterToString(value));
+ }
+
+ return parameters;
+ }
+
+ ///
+ /// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with
+ /// Configuration.DateTime.
+ /// If parameter is a list, join the list with ",".
+ /// Otherwise just return the string.
+ ///
+ /// The parameter (header, path, query, form).
+ /// An optional configuration instance, providing formatting options used in processing.
+ /// Formatted string.
+ public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
+ {
+ if (obj is DateTime dateTime)
+ // Return a formatted date string - Can be customized with Configuration.DateTimeFormat
+ // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
+ // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
+ // For example: 2009-06-15T13:45:30.0000000
+ return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
+ if (obj is DateTimeOffset dateTimeOffset)
+ // Return a formatted date string - Can be customized with Configuration.DateTimeFormat
+ // Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
+ // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
+ // For example: 2009-06-15T13:45:30.0000000
+ return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
+ if (obj is bool boolean)
+ return boolean ? "true" : "false";
+ if (obj is ICollection collection)
+ {
+ var entries = new List();
+ foreach (var entry in collection)
+ entries.Add(ParameterToString(entry, configuration));
+ return string.Join(",", entries);
+ }
+
+ if (obj is Enum && HasEnumMemberAttrValue(obj))
+ return GetEnumMemberAttrValue(obj);
+
+ return Convert.ToString(obj, CultureInfo.InvariantCulture);
+ }
+
+ ///
+ /// Serializes the given object when not null. Otherwise return null.
+ ///
+ /// The object to serialize.
+ /// Serialized string.
+ public static string Serialize(object obj)
+ {
+ return obj != null ? JsonConvert.SerializeObject(obj) : null;
+ }
+
+ ///
+ /// Encode string in base64 format.
+ ///
+ /// string to be encoded.
+ /// Encoded string.
+ public static string Base64Encode(string text)
+ {
+ return Convert.ToBase64String(Encoding.UTF8.GetBytes(text));
+ }
+
+ ///
+ /// Convert stream to byte array
+ ///
+ /// Input stream to be converted
+ /// Byte array
+ public static byte[] ReadAsBytes(Stream inputStream)
+ {
+ using (var ms = new MemoryStream())
+ {
+ inputStream.CopyTo(ms);
+ return ms.ToArray();
+ }
+ }
+
+ ///
+ /// Select the Content-Type header's value from the given content-type array:
+ /// if JSON type exists in the given array, use it;
+ /// otherwise use the first one defined in 'consumes'
+ ///
+ /// The Content-Type array to select from.
+ /// The Content-Type header to use.
+ public static string SelectHeaderContentType(string[] contentTypes)
+ {
+ if (contentTypes.Length == 0)
+ return null;
+
+ foreach (var contentType in contentTypes)
+ if (IsJsonMime(contentType))
+ return contentType;
+
+ return contentTypes[0]; // use the first content type specified in 'consumes'
+ }
+
+ ///
+ /// Select the Accept header's value from the given accepts array:
+ /// if JSON exists in the given array, use it;
+ /// otherwise use all of them (joining into a string)
+ ///
+ /// The accepts array to select from.
+ /// The Accept header to use.
+ public static string SelectHeaderAccept(string[] accepts)
+ {
+ if (accepts.Length == 0)
+ return null;
+
+ if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
+ return "application/json";
+
+ return string.Join(",", accepts);
+ }
+
+ ///
+ /// Check if the given MIME is a JSON MIME.
+ /// JSON MIME examples:
+ /// application/json
+ /// application/json; charset=UTF8
+ /// APPLICATION/JSON
+ /// application/vnd.company+json
+ ///
+ /// MIME
+ /// Returns True if MIME type is json.
+ public static bool IsJsonMime(string mime)
+ {
+ if (string.IsNullOrWhiteSpace(mime)) return false;
+
+ return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json");
+ }
+
+ ///
+ /// Is the Enum decorated with EnumMember Attribute
+ ///
+ ///
+ /// true if found
+ private static bool HasEnumMemberAttrValue(object enumVal)
+ {
+ if (enumVal == null)
+ throw new ArgumentNullException(nameof(enumVal));
+ var enumType = enumVal.GetType();
+ var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
+ var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType()
+ .FirstOrDefault();
+ if (attr != null) return true;
+ return false;
+ }
+
+ ///
+ /// Get the EnumMember value
+ ///
+ ///
+ /// EnumMember value as string otherwise null
+ private static string GetEnumMemberAttrValue(object enumVal)
+ {
+ if (enumVal == null)
+ throw new ArgumentNullException(nameof(enumVal));
+ var enumType = enumVal.GetType();
+ var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
+ var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType()
+ .FirstOrDefault();
+ if (attr != null) return attr.Value;
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs.meta b/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs.meta
new file mode 100644
index 000000000..78d3c0cf8
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ClientUtils.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ef431cbe445484f41b5545e3258be6ce
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/Configuration.cs b/src/Packages/Orderbook/Runtime/Client/Configuration.cs
new file mode 100644
index 000000000..603ece9f2
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/Configuration.cs
@@ -0,0 +1,556 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Represents a set of configuration settings
+ ///
+ public class Configuration : IReadableConfiguration
+ {
+ #region Static Members
+
+ ///
+ /// Default creation of exceptions for a given method name and response object
+ ///
+ public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
+ {
+ var status = (int)response.StatusCode;
+ if (status >= 400)
+ return new ApiException(status,
+ string.Format("Error calling {0}: {1}", methodName, response.RawContent),
+ response.RawContent, response.Headers);
+ if (status == 0)
+ return new ApiException(status,
+ string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText);
+ return null;
+ };
+
+ #endregion Static Members
+
+ #region Static Members
+
+ ///
+ /// Merge configurations.
+ ///
+ /// First configuration.
+ /// Second configuration.
+ /// Merged configuration.
+ public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first,
+ IReadableConfiguration second)
+ {
+ if (second == null) return first ?? GlobalConfiguration.Instance;
+
+ var apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
+ var apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
+ var defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
+
+ foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value;
+ foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value;
+ foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value;
+
+ var config = new Configuration
+ {
+ ApiKey = apiKey,
+ ApiKeyPrefix = apiKeyPrefix,
+ DefaultHeaders = defaultHeaders,
+ BasePath = second.BasePath ?? first.BasePath,
+ Timeout = second.Timeout,
+ Proxy = second.Proxy ?? first.Proxy,
+ UserAgent = second.UserAgent ?? first.UserAgent,
+ Username = second.Username ?? first.Username,
+ Password = second.Password ?? first.Password,
+ AccessToken = second.AccessToken ?? first.AccessToken,
+ TempFolderPath = second.TempFolderPath ?? first.TempFolderPath,
+ DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat,
+ ClientCertificates = second.ClientCertificates ?? first.ClientCertificates,
+ UseDefaultCredentials = second.UseDefaultCredentials,
+ RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ??
+ first.RemoteCertificateValidationCallback
+ };
+ return config;
+ }
+
+ #endregion Static Members
+
+ #region Constants
+
+ ///
+ /// Version of the package.
+ ///
+ /// Version of the package.
+ public const string Version = "1.0.0";
+
+ ///
+ /// Identifier for ISO 8601 DateTime Format
+ ///
+ /// See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.
+ // ReSharper disable once InconsistentNaming
+ public const string ISO8601_DATETIME_FORMAT = "o";
+
+ #endregion Constants
+
+ #region Private Members
+
+ ///
+ /// Defines the base path of the target API server.
+ /// Example: http://localhost:3000/v1/
+ ///
+ private string _basePath;
+
+ ///
+ /// Gets or sets the API key based on the authentication name.
+ /// This is the key and value comprising the "secret" for accessing an API.
+ ///
+ /// The API key.
+ private IDictionary _apiKey;
+
+ ///
+ /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
+ ///
+ /// The prefix of the API key.
+ private IDictionary _apiKeyPrefix;
+
+ private string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
+ private string _tempFolderPath = Path.GetTempPath();
+
+ ///
+ /// Gets or sets the servers defined in the OpenAPI spec.
+ ///
+ /// The servers
+ private IList> _servers;
+
+ ///
+ /// Gets or sets the operation servers defined in the OpenAPI spec.
+ ///
+ /// The operation servers
+ private IReadOnlyDictionary>> _operationServers;
+
+ #endregion Private Members
+
+ #region Constructors
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ [SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
+ public Configuration()
+ {
+ Proxy = null;
+ UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
+ BasePath = "https://api.immutable.com";
+ DefaultHeaders = new ConcurrentDictionary();
+ ApiKey = new ConcurrentDictionary();
+ ApiKeyPrefix = new ConcurrentDictionary();
+ Servers = new List>
+ {
+ new Dictionary
+ {
+ { "url", "https://api.immutable.com" },
+ { "description", "Production Server" }
+ },
+ new Dictionary
+ {
+ { "url", "https://api.sandbox.immutable.com" },
+ { "description", "Sandbox Server" }
+ }
+ };
+ OperationServers = new Dictionary>>();
+
+ // Setting Timeout has side effects (forces ApiClient creation).
+ Timeout = 100000;
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ [SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
+ public Configuration(
+ IDictionary defaultHeaders,
+ IDictionary apiKey,
+ IDictionary apiKeyPrefix,
+ string basePath = "https://api.immutable.com") : this()
+ {
+ if (string.IsNullOrWhiteSpace(basePath))
+ throw new ArgumentException("The provided basePath is invalid.", "basePath");
+ if (defaultHeaders == null)
+ throw new ArgumentNullException("defaultHeaders");
+ if (apiKey == null)
+ throw new ArgumentNullException("apiKey");
+ if (apiKeyPrefix == null)
+ throw new ArgumentNullException("apiKeyPrefix");
+
+ BasePath = basePath;
+
+ foreach (var keyValuePair in defaultHeaders) DefaultHeaders.Add(keyValuePair);
+
+ foreach (var keyValuePair in apiKey) ApiKey.Add(keyValuePair);
+
+ foreach (var keyValuePair in apiKeyPrefix) ApiKeyPrefix.Add(keyValuePair);
+ }
+
+ #endregion Constructors
+
+ #region Properties
+
+ ///
+ /// Gets or sets the base path for API access.
+ ///
+ public virtual string BasePath
+ {
+ get => _basePath;
+ set => _basePath = value;
+ }
+
+ ///
+ /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is
+ /// running) will be sent along to the server. The default is false.
+ ///
+ public virtual bool UseDefaultCredentials { get; set; }
+
+ ///
+ /// Gets or sets the default header.
+ ///
+ [Obsolete("Use DefaultHeaders instead.")]
+ public virtual IDictionary DefaultHeader
+ {
+ get => DefaultHeaders;
+ set => DefaultHeaders = value;
+ }
+
+ ///
+ /// Gets or sets the default headers.
+ ///
+ public virtual IDictionary DefaultHeaders { get; set; }
+
+ ///
+ /// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
+ ///
+ public virtual int Timeout { get; set; }
+
+ ///
+ /// Gets or sets the proxy
+ ///
+ /// Proxy.
+ public virtual WebProxy Proxy { get; set; }
+
+ ///
+ /// Gets or sets the HTTP user agent.
+ ///
+ /// Http user agent.
+ public virtual string UserAgent { get; set; }
+
+ ///
+ /// Gets or sets the username (HTTP basic authentication).
+ ///
+ /// The username.
+ public virtual string Username { get; set; }
+
+ ///
+ /// Gets or sets the password (HTTP basic authentication).
+ ///
+ /// The password.
+ public virtual string Password { get; set; }
+
+ ///
+ /// Gets the API key with prefix.
+ ///
+ /// API key identifier (authentication scheme).
+ /// API key with prefix.
+ public string GetApiKeyWithPrefix(string apiKeyIdentifier)
+ {
+ string apiKeyValue;
+ ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue);
+ string apiKeyPrefix;
+ if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix)) return apiKeyPrefix + " " + apiKeyValue;
+
+ return apiKeyValue;
+ }
+
+ ///
+ /// Gets or sets certificate collection to be sent with requests.
+ ///
+ /// X509 Certificate collection.
+ public X509CertificateCollection ClientCertificates { get; set; }
+
+ ///
+ /// Gets or sets the access token for OAuth2 authentication.
+ /// This helper property simplifies code generation.
+ ///
+ /// The access token.
+ public virtual string AccessToken { get; set; }
+
+ ///
+ /// Gets or sets the temporary folder path to store the files downloaded from the server.
+ ///
+ /// Folder path.
+ public virtual string TempFolderPath
+ {
+ get => _tempFolderPath;
+
+ set
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ _tempFolderPath = Path.GetTempPath();
+ return;
+ }
+
+ // create the directory if it does not exist
+ if (!Directory.Exists(value)) Directory.CreateDirectory(value);
+
+ // check if the path contains directory separator at the end
+ if (value[value.Length - 1] == Path.DirectorySeparatorChar)
+ _tempFolderPath = value;
+ else
+ _tempFolderPath = value + Path.DirectorySeparatorChar;
+ }
+ }
+
+ ///
+ /// Gets or sets the date time format used when serializing in the ApiClient
+ /// By default, it's set to ISO 8601 - "o", for others see:
+ /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
+ /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
+ /// No validation is done to ensure that the string you're providing is valid
+ ///
+ /// The DateTimeFormat string
+ public virtual string DateTimeFormat
+ {
+ get => _dateTimeFormat;
+ set
+ {
+ if (string.IsNullOrEmpty(value))
+ {
+ // Never allow a blank or null string, go back to the default
+ _dateTimeFormat = ISO8601_DATETIME_FORMAT;
+ return;
+ }
+
+ // Caution, no validation when you choose date time format other than ISO 8601
+ // Take a look at the above links
+ _dateTimeFormat = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
+ /// Whatever you set here will be prepended to the value defined in AddApiKey.
+ /// An example invocation here might be:
+ ///
+ /// ApiKeyPrefix["Authorization"] = "Bearer";
+ ///
+ /// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
+ ///
+ /// OAuth2 workflows should set tokens via AccessToken.
+ ///
+ ///
+ /// The prefix of the API key.
+ public virtual IDictionary ApiKeyPrefix
+ {
+ get => _apiKeyPrefix;
+ set
+ {
+ if (value == null) throw new InvalidOperationException("ApiKeyPrefix collection may not be null.");
+ _apiKeyPrefix = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the API key based on the authentication name.
+ ///
+ /// The API key.
+ public virtual IDictionary ApiKey
+ {
+ get => _apiKey;
+ set
+ {
+ if (value == null) throw new InvalidOperationException("ApiKey collection may not be null.");
+ _apiKey = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the servers.
+ ///
+ /// The servers.
+ public virtual IList> Servers
+ {
+ get => _servers;
+ set
+ {
+ if (value == null) throw new InvalidOperationException("Servers may not be null.");
+ _servers = value;
+ }
+ }
+
+ ///
+ /// Gets or sets the operation servers.
+ ///
+ /// The operation servers.
+ public virtual IReadOnlyDictionary>> OperationServers
+ {
+ get => _operationServers;
+ set
+ {
+ if (value == null) throw new InvalidOperationException("Operation servers may not be null.");
+ _operationServers = value;
+ }
+ }
+
+ ///
+ /// Returns URL based on server settings without providing values
+ /// for the variables
+ ///
+ /// Array index of the server settings.
+ /// The server URL.
+ public string GetServerUrl(int index)
+ {
+ return GetServerUrl(Servers, index, null);
+ }
+
+ ///
+ /// Returns URL based on server settings.
+ ///
+ /// Array index of the server settings.
+ /// Dictionary of the variables and the corresponding values.
+ /// The server URL.
+ public string GetServerUrl(int index, Dictionary inputVariables)
+ {
+ return GetServerUrl(Servers, index, inputVariables);
+ }
+
+ ///
+ /// Returns URL based on operation server settings.
+ ///
+ /// Operation associated with the request path.
+ /// Array index of the server settings.
+ /// The operation server URL.
+ public string GetOperationServerUrl(string operation, int index)
+ {
+ return GetOperationServerUrl(operation, index, null);
+ }
+
+ ///
+ /// Returns URL based on operation server settings.
+ ///
+ /// Operation associated with the request path.
+ /// Array index of the server settings.
+ /// Dictionary of the variables and the corresponding values.
+ /// The operation server URL.
+ public string GetOperationServerUrl(string operation, int index, Dictionary inputVariables)
+ {
+ if (operation != null && OperationServers.TryGetValue(operation, out var operationServer))
+ return GetServerUrl(operationServer, index, inputVariables);
+
+ return null;
+ }
+
+ ///
+ /// Returns URL based on server settings.
+ ///
+ /// Dictionary of server settings.
+ /// Array index of the server settings.
+ /// Dictionary of the variables and the corresponding values.
+ /// The server URL.
+ private string GetServerUrl(IList> servers, int index,
+ Dictionary inputVariables)
+ {
+ if (index < 0 || index >= servers.Count)
+ throw new InvalidOperationException(
+ $"Invalid index {index} when selecting the server. Must be less than {servers.Count}.");
+
+ if (inputVariables == null) inputVariables = new Dictionary();
+
+ var server = servers[index];
+ var url = (string)server["url"];
+
+ if (server.ContainsKey("variables"))
+ // go through each variable and assign a value
+ foreach (var variable in (IReadOnlyDictionary)server["variables"])
+ {
+ var serverVariables = (IReadOnlyDictionary)variable.Value;
+
+ if (inputVariables.ContainsKey(variable.Key))
+ {
+ if (((List)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
+ url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]);
+ else
+ throw new InvalidOperationException(
+ $"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List)serverVariables["enum_values"]}");
+ }
+ else
+ {
+ // use default value
+ url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
+ }
+ }
+
+ return url;
+ }
+
+ ///
+ /// Gets and Sets the RemoteCertificateValidationCallback
+ ///
+ public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
+
+ #endregion Properties
+
+ #region Methods
+
+ ///
+ /// Returns a string with essential information for debugging.
+ ///
+ public static string ToDebugReport()
+ {
+ var report = "C# SDK (Immutable.Orderbook) Debug Report:\n";
+ report += " OS: " + Environment.OSVersion + "\n";
+ report += " .NET Framework Version: " + Environment.Version + "\n";
+ report += " Version of the API: 1.0.0\n";
+ report += " SDK Package Version: 1.0.0\n";
+
+ return report;
+ }
+
+ ///
+ /// Add Api Key Header.
+ ///
+ /// Api Key name.
+ /// Api Key value.
+ ///
+ public void AddApiKey(string key, string value)
+ {
+ ApiKey[key] = value;
+ }
+
+ ///
+ /// Sets the API key prefix.
+ ///
+ /// Api Key name.
+ /// Api Key value.
+ public void AddApiKeyPrefix(string key, string value)
+ {
+ ApiKeyPrefix[key] = value;
+ }
+
+ #endregion Methods
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/Configuration.cs.meta b/src/Packages/Orderbook/Runtime/Client/Configuration.cs.meta
new file mode 100644
index 000000000..525a8587d
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/Configuration.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8952e23889cfc44b298b8198484866e1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs b/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs
new file mode 100644
index 000000000..15bc838f5
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs
@@ -0,0 +1,30 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using UnityEngine.Networking;
+
+namespace Immutable.Orderbook.Client
+{
+ public class ConnectionException : Exception
+ {
+ // NOTE: Cannot keep reference to the request since it will be disposed.
+ public ConnectionException(UnityWebRequest request)
+ : base($"result={request.result} error={request.error}")
+ {
+ Result = request.result;
+ Error = request.error ?? "";
+ }
+
+ public UnityWebRequest.Result Result { get; private set; }
+ public string Error { get; private set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs.meta b/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs.meta
new file mode 100644
index 000000000..ee34af7a1
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ConnectionException.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d75edb05a10ca4f47ac82074735a3e37
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs b/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs
new file mode 100644
index 000000000..4d120f3e0
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs
@@ -0,0 +1,23 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// A delegate to ExceptionFactory method
+ ///
+ /// Method name
+ /// Response
+ /// Exceptions
+ public delegate Exception ExceptionFactory(string methodName, IApiResponse response);
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs.meta b/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs.meta
new file mode 100644
index 000000000..0a59f5680
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ExceptionFactory.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 03d691f5d6c94405eb012bcfce6686ec
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs b/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs
new file mode 100644
index 000000000..649fb72ea
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs
@@ -0,0 +1,70 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Collections.Generic;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// provides a compile-time extension point for globally configuring
+ /// API Clients.
+ ///
+ ///
+ /// A customized implementation via partial class may reside in another file and may
+ /// be excluded from automatic generation via a .openapi-generator-ignore file.
+ ///
+ public class GlobalConfiguration : Configuration
+ {
+ ///
+ /// Gets or sets the default Configuration.
+ ///
+ /// Configuration.
+ public static IReadableConfiguration Instance
+ {
+ get => _globalConfiguration;
+ set
+ {
+ lock (GlobalConfigSync)
+ {
+ _globalConfiguration = value;
+ }
+ }
+ }
+
+ #region Private Members
+
+ private static readonly object GlobalConfigSync = new { };
+ private static IReadableConfiguration _globalConfiguration;
+
+ #endregion Private Members
+
+ #region Constructors
+
+ ///
+ private GlobalConfiguration()
+ {
+ }
+
+ ///
+ public GlobalConfiguration(IDictionary defaultHeader, IDictionary apiKey,
+ IDictionary apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(
+ defaultHeader, apiKey, apiKeyPrefix, basePath)
+ {
+ }
+
+ static GlobalConfiguration()
+ {
+ Instance = new GlobalConfiguration();
+ }
+
+ #endregion Constructors
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs.meta b/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs.meta
new file mode 100644
index 000000000..815464f8b
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/GlobalConfiguration.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bfa59515393b24c5ea88038562af03c1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs b/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs
new file mode 100644
index 000000000..d064ee70f
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs
@@ -0,0 +1,36 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Represents configuration aspects required to interact with the API endpoints.
+ ///
+ public interface IApiAccessor
+ {
+ ///
+ /// Gets or sets the configuration object
+ ///
+ /// An instance of the Configuration
+ IReadableConfiguration Configuration { get; set; }
+
+ ///
+ /// Provides a factory method hook for the creation of exceptions.
+ ///
+ ExceptionFactory ExceptionFactory { get; set; }
+
+ ///
+ /// Gets the base path of the API client.
+ ///
+ /// The base path
+ string GetBasePath();
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs.meta b/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs.meta
new file mode 100644
index 000000000..64355333f
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IApiAccessor.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6bda536ffdaf44180b36227b8e0cbaaa
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs b/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs
new file mode 100644
index 000000000..be02c489c
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs
@@ -0,0 +1,107 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Contract for Asynchronous RESTful API interactions.
+ /// This interface allows consumers to provide a custom API accessor client.
+ ///
+ public interface IAsynchronousClient
+ {
+ ///
+ /// Executes a non-blocking call to some using the GET http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> GetAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the POST http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> PostAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the PUT http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> PutAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the DELETE http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> DeleteAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the HEAD http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> HeadAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the OPTIONS http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> OptionsAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+
+ ///
+ /// Executes a non-blocking call to some using the PATCH http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// Cancellation Token to cancel the request.
+ /// The return type.
+ /// A task eventually representing the response data, decorated with
+ Task> PatchAsync(string path, RequestOptions options,
+ IReadableConfiguration configuration = null, CancellationToken cancellationToken = default);
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs.meta b/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs.meta
new file mode 100644
index 000000000..943224cae
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IAsynchronousClient.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0fe584920b7694ef2958c0dd983ec113
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs b/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs
new file mode 100644
index 000000000..23b7496cf
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs
@@ -0,0 +1,143 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Net;
+using System.Net.Security;
+using System.Security.Cryptography.X509Certificates;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Represents a readable-only configuration contract.
+ ///
+ public interface IReadableConfiguration
+ {
+ ///
+ /// Gets the access token.
+ ///
+ /// Access token.
+ string AccessToken { get; }
+
+ ///
+ /// Gets the API key.
+ ///
+ /// API key.
+ IDictionary ApiKey { get; }
+
+ ///
+ /// Gets the API key prefix.
+ ///
+ /// API key prefix.
+ IDictionary ApiKeyPrefix { get; }
+
+ ///
+ /// Gets the base path.
+ ///
+ /// Base path.
+ string BasePath { get; }
+
+ ///
+ /// Gets the date time format.
+ ///
+ /// Date time format.
+ string DateTimeFormat { get; }
+
+ ///
+ /// Gets the default header.
+ ///
+ /// Default header.
+ [Obsolete("Use DefaultHeaders instead.")]
+ IDictionary DefaultHeader { get; }
+
+ ///
+ /// Gets the default headers.
+ ///
+ /// Default headers.
+ IDictionary DefaultHeaders { get; }
+
+ ///
+ /// Gets the temp folder path.
+ ///
+ /// Temp folder path.
+ string TempFolderPath { get; }
+
+ ///
+ /// Gets the HTTP connection timeout (in milliseconds)
+ ///
+ /// HTTP connection timeout.
+ int Timeout { get; }
+
+ ///
+ /// Gets the proxy.
+ ///
+ /// Proxy.
+ WebProxy Proxy { get; }
+
+ ///
+ /// Gets the user agent.
+ ///
+ /// User agent.
+ string UserAgent { get; }
+
+ ///
+ /// Gets the username.
+ ///
+ /// Username.
+ string Username { get; }
+
+ ///
+ /// Gets the password.
+ ///
+ /// Password.
+ string Password { get; }
+
+ ///
+ /// Determine whether or not the "default credentials" (e.g. the user account under which the current process is
+ /// running) will be sent along to the server. The default is false.
+ ///
+ bool UseDefaultCredentials { get; }
+
+ ///
+ /// Get the servers associated with the operation.
+ ///
+ /// Operation servers.
+ IReadOnlyDictionary>> OperationServers { get; }
+
+ ///
+ /// Gets certificate collection to be sent with requests.
+ ///
+ /// X509 Certificate collection.
+ X509CertificateCollection ClientCertificates { get; }
+
+ ///
+ /// Callback function for handling the validation of remote certificates. Useful for certificate pinning and
+ /// overriding certificate errors in the scope of a request.
+ ///
+ RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; }
+
+ ///
+ /// Gets the API key with prefix.
+ ///
+ /// API key identifier (authentication scheme).
+ /// API key with prefix.
+ string GetApiKeyWithPrefix(string apiKeyIdentifier);
+
+ ///
+ /// Gets the Operation server url at the provided index.
+ ///
+ /// Operation server name.
+ /// Index of the operation server settings.
+ ///
+ string GetOperationServerUrl(string operation, int index);
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs.meta b/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs.meta
new file mode 100644
index 000000000..8d63f60d9
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/IReadableConfiguration.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 98e2e2c65c1a24bb4a7ecec6fdca4d1a
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs b/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs
new file mode 100644
index 000000000..10e744045
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs
@@ -0,0 +1,90 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Contract for Synchronous RESTful API interactions.
+ /// This interface allows consumers to provide a custom API accessor client.
+ ///
+ public interface ISynchronousClient
+ {
+ ///
+ /// Executes a blocking call to some using the GET http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Get(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the POST http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Post(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the PUT http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Put(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the DELETE http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Delete(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the HEAD http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Head(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the OPTIONS http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Options(string path, RequestOptions options, IReadableConfiguration configuration = null);
+
+ ///
+ /// Executes a blocking call to some using the PATCH http verb.
+ ///
+ /// The relative path to invoke.
+ /// The request parameters to pass along to the client.
+ /// Per-request configurable settings.
+ /// The return type.
+ /// The response data, decorated with
+ ApiResponse Patch(string path, RequestOptions options, IReadableConfiguration configuration = null);
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs.meta b/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs.meta
new file mode 100644
index 000000000..e3e10d9bd
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/ISynchronousClient.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 2e969ca04b4ed41fd8d35e1eb523c7d8
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/Multimap.cs b/src/Packages/Orderbook/Runtime/Client/Multimap.cs
new file mode 100644
index 000000000..26e1cf622
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/Multimap.cs
@@ -0,0 +1,306 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// A dictionary in which one key has many associated values.
+ ///
+ /// The type of the key
+ /// The type of the value associated with the key.
+ public class Multimap : IDictionary>
+ {
+ #region Private Fields
+
+ private readonly Dictionary> _dictionary;
+
+ #endregion Private Fields
+
+ #region Constructors
+
+ ///
+ /// Empty Constructor.
+ ///
+ public Multimap()
+ {
+ _dictionary = new Dictionary>();
+ }
+
+ ///
+ /// Constructor with comparer.
+ ///
+ ///
+ public Multimap(IEqualityComparer comparer)
+ {
+ _dictionary = new Dictionary>(comparer);
+ }
+
+ #endregion Constructors
+
+ #region Enumerators
+
+ ///
+ /// To get the enumerator.
+ ///
+ /// Enumerator
+ public IEnumerator>> GetEnumerator()
+ {
+ return _dictionary.GetEnumerator();
+ }
+
+ ///
+ /// To get the enumerator.
+ ///
+ /// Enumerator
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return _dictionary.GetEnumerator();
+ }
+
+ #endregion Enumerators
+
+ #region Public Members
+
+ ///
+ /// Add values to Multimap
+ ///
+ /// Key value pair
+ public void Add(KeyValuePair> item)
+ {
+ if (!TryAdd(item.Key, item.Value))
+ throw new InvalidOperationException("Could not add values to Multimap.");
+ }
+
+ ///
+ /// Add Multimap to Multimap
+ ///
+ /// Multimap
+ public void Add(Multimap multimap)
+ {
+ foreach (var item in multimap)
+ if (!TryAdd(item.Key, item.Value))
+ throw new InvalidOperationException("Could not add values to Multimap.");
+ }
+
+ ///
+ /// Clear Multimap
+ ///
+ public void Clear()
+ {
+ _dictionary.Clear();
+ }
+
+ ///
+ /// Determines whether Multimap contains the specified item.
+ ///
+ /// Key value pair
+ /// Method needs to be implemented
+ /// true if the Multimap contains the item; otherwise, false.
+ public bool Contains(KeyValuePair> item)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Copy items of the Multimap to an array,
+ /// starting at a particular array index.
+ ///
+ ///
+ /// The array that is the destination of the items copied
+ /// from Multimap. The array must have zero-based indexing.
+ ///
+ /// The zero-based index in array at which copying begins.
+ /// Method needs to be implemented
+ public void CopyTo(KeyValuePair>[] array, int arrayIndex)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Removes the specified item from the Multimap.
+ ///
+ /// Key value pair
+ /// true if the item is successfully removed; otherwise, false.
+ /// Method needs to be implemented
+ public bool Remove(KeyValuePair> item)
+ {
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Gets the number of items contained in the Multimap.
+ ///
+ public int Count => _dictionary.Count;
+
+ ///
+ /// Gets a value indicating whether the Multimap is read-only.
+ ///
+ public bool IsReadOnly => false;
+
+ ///
+ /// Adds an item with the provided key and value to the Multimap.
+ ///
+ /// The object to use as the key of the item to add.
+ /// The object to use as the value of the item to add.
+ /// Thrown when couldn't add the value to Multimap.
+ public void Add(TKey key, IList value)
+ {
+ if (value != null && value.Count > 0)
+ {
+ if (_dictionary.TryGetValue(key, out var list))
+ {
+ foreach (var k in value) list.Add(k);
+ }
+ else
+ {
+ list = new List(value);
+ if (!TryAdd(key, list))
+ throw new InvalidOperationException("Could not add values to Multimap.");
+ }
+ }
+ }
+
+ ///
+ /// Determines whether the Multimap contains an item with the specified key.
+ ///
+ /// The key to locate in the Multimap.
+ ///
+ /// true if the Multimap contains an item with
+ /// the key; otherwise, false.
+ ///
+ public bool ContainsKey(TKey key)
+ {
+ return _dictionary.ContainsKey(key);
+ }
+
+ ///
+ /// Removes item with the specified key from the Multimap.
+ ///
+ /// The key to locate in the Multimap.
+ /// true if the item is successfully removed; otherwise, false.
+ public bool Remove(TKey key)
+ {
+ return TryRemove(key, out var _);
+ }
+
+ ///
+ /// Gets the value associated with the specified key.
+ ///
+ /// The key whose value to get.
+ ///
+ /// When this method returns, the value associated with the specified key, if the
+ /// key is found; otherwise, the default value for the type of the value parameter.
+ /// This parameter is passed uninitialized.
+ ///
+ ///
+ /// true if the object that implements Multimap contains
+ /// an item with the specified key; otherwise, false.
+ ///
+ public bool TryGetValue(TKey key, out IList value)
+ {
+ return _dictionary.TryGetValue(key, out value);
+ }
+
+ ///
+ /// Gets or sets the item with the specified key.
+ ///
+ /// The key of the item to get or set.
+ /// The value of the specified key.
+ public IList this[TKey key]
+ {
+ get => _dictionary[key];
+ set => _dictionary[key] = value;
+ }
+
+ ///
+ /// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
+ ///
+ public ICollection Keys => _dictionary.Keys;
+
+ ///
+ /// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
+ ///
+ public ICollection> Values => _dictionary.Values;
+
+ ///
+ /// Copy the items of the Multimap to an System.Array,
+ /// starting at a particular System.Array index.
+ ///
+ ///
+ /// The one-dimensional System.Array that is the destination of the items copied
+ /// from Multimap. The System.Array must have zero-based indexing.
+ ///
+ /// The zero-based index in array at which copying begins.
+ public void CopyTo(Array array, int index)
+ {
+ ((ICollection)_dictionary).CopyTo(array, index);
+ }
+
+ ///
+ /// Adds an item with the provided key and value to the Multimap.
+ ///
+ /// The object to use as the key of the item to add.
+ /// The object to use as the value of the item to add.
+ /// Thrown when couldn't add value to Multimap.
+ public void Add(TKey key, TValue value)
+ {
+ if (value != null)
+ {
+ if (_dictionary.TryGetValue(key, out var list))
+ {
+ list.Add(value);
+ }
+ else
+ {
+ list = new List { value };
+ if (!TryAdd(key, list))
+ throw new InvalidOperationException("Could not add value to Multimap.");
+ }
+ }
+ }
+
+ #endregion Public Members
+
+ #region Private Members
+
+ /**
+ * Helper method to encapsulate generator differences between dictionary types.
+ */
+ private bool TryRemove(TKey key, out IList value)
+ {
+ _dictionary.TryGetValue(key, out value);
+ return _dictionary.Remove(key);
+ }
+
+ /**
+ * Helper method to encapsulate generator differences between dictionary types.
+ */
+ private bool TryAdd(TKey key, IList value)
+ {
+ try
+ {
+ _dictionary.Add(key, value);
+ }
+ catch (ArgumentException)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ #endregion Private Members
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/Multimap.cs.meta b/src/Packages/Orderbook/Runtime/Client/Multimap.cs.meta
new file mode 100644
index 000000000..12ac87065
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/Multimap.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1436a51ce69294e2eba88634003ef689
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs b/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs
new file mode 100644
index 000000000..4efb016bc
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs
@@ -0,0 +1,30 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using Newtonsoft.Json.Converters;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
+ /// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
+ ///
+ public class OpenAPIDateConverter : IsoDateTimeConverter
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public OpenAPIDateConverter()
+ {
+ // full-date = date-fullyear "-" date-month "-" date-mday
+ DateTimeFormat = "yyyy-MM-dd";
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs.meta b/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs.meta
new file mode 100644
index 000000000..3b8fef128
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/OpenAPIDateConverter.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 74be10b8543804fc49003a9b9945dbe0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs b/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs
new file mode 100644
index 000000000..c537c552d
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs
@@ -0,0 +1,67 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Collections.Generic;
+using System.Net;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// A container for generalized request inputs. This type allows consumers to extend the request functionality
+ /// by abstracting away from the default (built-in) request framework (e.g. RestSharp).
+ ///
+ public class RequestOptions
+ {
+ ///
+ /// Constructs a new instance of
+ ///
+ public RequestOptions()
+ {
+ PathParameters = new Dictionary();
+ QueryParameters = new Multimap();
+ HeaderParameters = new Multimap();
+ FormParameters = new Dictionary();
+ Cookies = new List();
+ }
+
+ ///
+ /// Parameters to be bound to path parts of the Request's URL
+ ///
+ public Dictionary PathParameters { get; set; }
+
+ ///
+ /// Query parameters to be applied to the request.
+ /// Keys may have 1 or more values associated.
+ ///
+ public Multimap QueryParameters { get; set; }
+
+ ///
+ /// Header parameters to be applied to to the request.
+ /// Keys may have 1 or more values associated.
+ ///
+ public Multimap HeaderParameters { get; set; }
+
+ ///
+ /// Form parameters to be sent along with the request.
+ ///
+ public Dictionary FormParameters { get; set; }
+
+ ///
+ /// Cookies to be sent along with the request.
+ ///
+ public List Cookies { get; set; }
+
+ ///
+ /// Any data associated with a request body.
+ ///
+ public object Data { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs.meta b/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs.meta
new file mode 100644
index 000000000..766184d79
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/RequestOptions.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3987679738a3a49dfaf7339074fa9325
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs b/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs
new file mode 100644
index 000000000..ce9e15da3
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs
@@ -0,0 +1,35 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using UnityEngine.Networking;
+
+namespace Immutable.Orderbook.Client
+{
+ // Thrown when a backend doesn't return an expected response based on the expected type
+ // of the response data.
+ public class UnexpectedResponseException : Exception
+ {
+ // NOTE: Cannot keep reference to the request since it will be disposed.
+ public UnexpectedResponseException(UnityWebRequest request, Type type, string extra = "")
+ : base(CreateMessage(request, type, extra))
+ {
+ ErrorCode = (int)request.responseCode;
+ }
+
+ public int ErrorCode { get; private set; }
+
+ private static string CreateMessage(UnityWebRequest request, Type type, string extra)
+ {
+ return $"httpcode={request.responseCode}, expected {type.Name} but got data: {extra}";
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs.meta b/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs.meta
new file mode 100644
index 000000000..d5d960ff9
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/UnexpectedResponseException.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 21b75698542ac4ca2825789d97ccc566
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs b/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs
new file mode 100644
index 000000000..36dd733ef
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs
@@ -0,0 +1,49 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+using System;
+using System.Collections.Generic;
+
+namespace Immutable.Orderbook.Client
+{
+ ///
+ /// A URI builder
+ ///
+ internal class WebRequestPathBuilder
+ {
+ private readonly string _baseUrl;
+ private string _path;
+ private string _query = "?";
+
+ public WebRequestPathBuilder(string baseUrl, string path)
+ {
+ _baseUrl = baseUrl;
+ _path = path;
+ }
+
+ public void AddPathParameters(Dictionary parameters)
+ {
+ foreach (var parameter in parameters)
+ _path = _path.Replace("{" + parameter.Key + "}", Uri.EscapeDataString(parameter.Value));
+ }
+
+ public void AddQueryParameters(Multimap parameters)
+ {
+ foreach (var parameter in parameters)
+ foreach (var value in parameter.Value)
+ _query = _query + parameter.Key + "=" + Uri.EscapeDataString(value) + "&";
+ }
+
+ public string GetFullUri()
+ {
+ return _baseUrl + _path + _query.Substring(0, _query.Length - 1);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs.meta b/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs.meta
new file mode 100644
index 000000000..4dc9c59d5
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Client/WebRequestPathBuilder.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7d4d8fb97dd244fa6b7eba24ba023311
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef b/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef
new file mode 100644
index 000000000..2691e6616
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef
@@ -0,0 +1,18 @@
+{
+ "name": "Immutable.Orderbook",
+ "rootNamespace": "Immutable.Orderbook",
+ "references": [
+ "UniTask"
+ ],
+ "precompiledReferences": [
+ "Newtonsoft.Json.dll"
+ ],
+ "includePlatforms": [],
+ "excludePlatforms": [],
+ "allowUnsafeCode": false,
+ "overrideReferences": true,
+ "autoReferenced": true,
+ "defineConstraints": [],
+ "versionDefines": [],
+ "noEngineReferences": false
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef.meta b/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef.meta
new file mode 100644
index 000000000..660cfdedb
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Immutable.Orderbook.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: c7a369c5a572d4b6b84cab646212889e
+AssemblyDefinitionImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model.meta b/src/Packages/Orderbook/Runtime/Model.meta
new file mode 100644
index 000000000..84a7ad8b1
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: e471dd62905e04c72b0fe98123b9bdc5
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs b/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs
new file mode 100644
index 000000000..c1037e54f
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs
@@ -0,0 +1,76 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using Newtonsoft.Json;
+using Newtonsoft.Json.Serialization;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification
+ ///
+ public abstract class AbstractOpenAPISchema
+ {
+ ///
+ /// Custom JSON serializer
+ ///
+ public static readonly JsonSerializerSettings SerializerSettings = new()
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ MissingMemberHandling = MissingMemberHandling.Error,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ ///
+ /// Custom JSON serializer for objects with additional properties
+ ///
+ public static readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new()
+ {
+ // OpenAPI generated types generally hide default constructors.
+ ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
+ MissingMemberHandling = MissingMemberHandling.Ignore,
+ ContractResolver = new DefaultContractResolver
+ {
+ NamingStrategy = new CamelCaseNamingStrategy
+ {
+ OverrideSpecifiedNames = false
+ }
+ }
+ };
+
+ ///
+ /// Gets or Sets the actual instance
+ ///
+ public abstract object ActualInstance { get; set; }
+
+ ///
+ /// Gets or Sets IsNullable to indicate whether the instance is nullable
+ ///
+ public bool IsNullable { get; protected set; }
+
+ ///
+ /// Gets or Sets the schema type, which can be either `oneOf` or `anyOf`
+ ///
+ public string SchemaType { get; protected set; }
+
+ ///
+ /// Converts the instance into JSON string.
+ ///
+ public abstract string ToJson();
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs.meta b/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs.meta
new file mode 100644
index 000000000..0a60630e5
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/AbstractOpenAPISchema.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 32394cf4038734871970ede48b09f724
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/Action.cs b/src/Packages/Orderbook/Runtime/Model/Action.cs
new file mode 100644
index 000000000..bf3cfc2d4
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/Action.cs
@@ -0,0 +1,226 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// Action
+ ///
+ [JsonConverter(typeof(ActionJsonConverter))]
+ [DataContract(Name = "Action")]
+ public class Action : AbstractOpenAPISchema
+ {
+ private object _actualInstance;
+
+ ///
+ /// Initializes a new instance of the class
+ /// with the class
+ ///
+ /// An instance of TransactionAction.
+ public Action(TransactionAction actualInstance)
+ {
+ IsNullable = false;
+ SchemaType = "oneOf";
+ ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// with the class
+ ///
+ /// An instance of SignableAction.
+ public Action(SignableAction actualInstance)
+ {
+ IsNullable = false;
+ SchemaType = "oneOf";
+ ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
+ }
+
+ ///
+ /// Gets or Sets ActualInstance
+ ///
+ public override object ActualInstance
+ {
+ get => _actualInstance;
+ set
+ {
+ if (value.GetType() == typeof(SignableAction) || value is SignableAction)
+ _actualInstance = value;
+ else if (value.GetType() == typeof(TransactionAction) || value is TransactionAction)
+ _actualInstance = value;
+ else
+ throw new ArgumentException(
+ "Invalid instance found. Must be the following types: SignableAction, TransactionAction");
+ }
+ }
+
+ ///
+ /// Get the actual instance of `TransactionAction`. If the actual instance is not `TransactionAction`,
+ /// the InvalidClassException will be thrown
+ ///
+ /// An instance of TransactionAction
+ public TransactionAction GetTransactionAction()
+ {
+ return (TransactionAction)ActualInstance;
+ }
+
+ ///
+ /// Get the actual instance of `SignableAction`. If the actual instance is not `SignableAction`,
+ /// the InvalidClassException will be thrown
+ ///
+ /// An instance of SignableAction
+ public SignableAction GetSignableAction()
+ {
+ return (SignableAction)ActualInstance;
+ }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class Action {\n");
+ sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public override string ToJson()
+ {
+ return JsonConvert.SerializeObject(ActualInstance, SerializerSettings);
+ }
+
+ ///
+ /// Converts the JSON string into an instance of Action
+ ///
+ /// JSON string
+ /// An instance of Action
+ public static Action FromJson(string jsonString)
+ {
+ Action newAction = null;
+
+ if (string.IsNullOrEmpty(jsonString)) return newAction;
+ var match = 0;
+ var matchedTypes = new List();
+
+ try
+ {
+ // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
+ if (typeof(SignableAction).GetProperty("AdditionalProperties") == null)
+ newAction = new Action(
+ JsonConvert.DeserializeObject(jsonString, SerializerSettings));
+ else
+ newAction = new Action(JsonConvert.DeserializeObject(jsonString,
+ AdditionalPropertiesSerializerSettings));
+ matchedTypes.Add("SignableAction");
+ match++;
+ }
+ catch (Exception exception)
+ {
+ // deserialization failed, try the next one
+ Debug.WriteLine("Failed to deserialize `{0}` into SignableAction: {1}", jsonString, exception);
+ }
+
+ try
+ {
+ // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
+ if (typeof(TransactionAction).GetProperty("AdditionalProperties") == null)
+ newAction = new Action(
+ JsonConvert.DeserializeObject(jsonString, SerializerSettings));
+ else
+ newAction = new Action(JsonConvert.DeserializeObject(jsonString,
+ AdditionalPropertiesSerializerSettings));
+ matchedTypes.Add("TransactionAction");
+ match++;
+ }
+ catch (Exception exception)
+ {
+ // deserialization failed, try the next one
+ Debug.WriteLine("Failed to deserialize `{0}` into TransactionAction: {1}", jsonString, exception);
+ }
+
+ if (match == 0)
+ throw new InvalidDataException("The JSON string `" + jsonString +
+ "` cannot be deserialized into any schema defined.");
+ if (match > 1)
+ throw new InvalidDataException("The JSON string `" + jsonString +
+ "` incorrectly matches more than one schema (should be exactly one match): " +
+ string.Join(",", matchedTypes));
+
+ // deserialization is considered successful at this point if no exception has been thrown.
+ return newAction;
+ }
+ }
+
+ ///
+ /// Custom JSON converter for Action
+ ///
+ public class ActionJsonConverter : JsonConverter
+ {
+ ///
+ /// To write the JSON string
+ ///
+ /// JSON writer
+ /// Object to be converted into a JSON string
+ /// JSON Serializer
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ writer.WriteRawValue((string)typeof(Action).GetMethod("ToJson").Invoke(value, null));
+ }
+
+ ///
+ /// To convert a JSON string into an object
+ ///
+ /// JSON reader
+ /// Object type
+ /// Existing value
+ /// JSON Serializer
+ /// The object converted from the JSON string
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
+ JsonSerializer serializer)
+ {
+ switch (reader.TokenType)
+ {
+ case JsonToken.StartObject:
+ return Action.FromJson(JObject.Load(reader).ToString(Formatting.None));
+ case JsonToken.StartArray:
+ return Action.FromJson(JArray.Load(reader).ToString(Formatting.None));
+ default:
+ return null;
+ }
+ }
+
+ ///
+ /// Check if the object can be converted
+ ///
+ /// Object type
+ /// True if the object can be converted
+ public override bool CanConvert(Type objectType)
+ {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Model/Action.cs.meta b/src/Packages/Orderbook/Runtime/Model/Action.cs.meta
new file mode 100644
index 000000000..2d0390d88
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/Action.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 641cf8eb636fb43438dbcea19dc66e1e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs b/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs
new file mode 100644
index 000000000..625a9898e
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs
@@ -0,0 +1,231 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// Any type that can be used where a big number is needed.
+ ///
+ [JsonConverter(typeof(BigNumberishJsonConverter))]
+ [DataContract(Name = "BigNumberish")]
+ public class BigNumberish : AbstractOpenAPISchema
+ {
+ private object _actualInstance;
+
+ ///
+ /// Initializes a new instance of the class
+ /// with the class
+ ///
+ /// An instance of string.
+ public BigNumberish(string actualInstance)
+ {
+ IsNullable = false;
+ SchemaType = "oneOf";
+ ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
+ }
+
+ ///
+ /// Initializes a new instance of the class
+ /// with the class
+ ///
+ /// An instance of decimal.
+ public BigNumberish(decimal actualInstance)
+ {
+ IsNullable = false;
+ SchemaType = "oneOf";
+ ActualInstance = actualInstance;
+ }
+
+ ///
+ /// Gets or Sets ActualInstance
+ ///
+ public override object ActualInstance
+ {
+ get => _actualInstance;
+ set
+ {
+ if (value.GetType() == typeof(decimal) || value is decimal)
+ _actualInstance = value;
+ else if (value.GetType() == typeof(string) || value is string)
+ _actualInstance = value;
+ else
+ throw new ArgumentException("Invalid instance found. Must be the following types: decimal, string");
+ }
+ }
+
+ ///
+ /// Get the actual instance of `string`. If the actual instance is not `string`,
+ /// the InvalidClassException will be thrown
+ ///
+ /// An instance of string
+ public string GetString()
+ {
+ return (string)ActualInstance;
+ }
+
+ ///
+ /// Get the actual instance of `decimal`. If the actual instance is not `decimal`,
+ /// the InvalidClassException will be thrown
+ ///
+ /// An instance of decimal
+ public decimal GetDecimal()
+ {
+ return (decimal)ActualInstance;
+ }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class BigNumberish {\n");
+ sb.Append(" ActualInstance: ").Append(ActualInstance).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public override string ToJson()
+ {
+ return JsonConvert.SerializeObject(ActualInstance, SerializerSettings);
+ }
+
+ ///
+ /// Converts the JSON string into an instance of BigNumberish
+ ///
+ /// JSON string
+ /// An instance of BigNumberish
+ public static BigNumberish FromJson(string jsonString)
+ {
+ BigNumberish newBigNumberish = null;
+
+ if (string.IsNullOrEmpty(jsonString)) return newBigNumberish;
+ var match = 0;
+ var matchedTypes = new List();
+
+ try
+ {
+ // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
+ if (typeof(decimal).GetProperty("AdditionalProperties") == null)
+ newBigNumberish =
+ new BigNumberish(JsonConvert.DeserializeObject(jsonString, SerializerSettings));
+ else
+ newBigNumberish =
+ new BigNumberish(JsonConvert.DeserializeObject(jsonString,
+ AdditionalPropertiesSerializerSettings));
+ matchedTypes.Add("decimal");
+ match++;
+ }
+ catch (Exception exception)
+ {
+ // deserialization failed, try the next one
+ Debug.WriteLine("Failed to deserialize `{0}` into decimal: {1}", jsonString, exception);
+ }
+
+ try
+ {
+ // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
+ if (typeof(string).GetProperty("AdditionalProperties") == null)
+ newBigNumberish =
+ new BigNumberish(JsonConvert.DeserializeObject(jsonString, SerializerSettings));
+ else
+ newBigNumberish =
+ new BigNumberish(JsonConvert.DeserializeObject(jsonString,
+ AdditionalPropertiesSerializerSettings));
+ matchedTypes.Add("string");
+ match++;
+ }
+ catch (Exception exception)
+ {
+ // deserialization failed, try the next one
+ Debug.WriteLine("Failed to deserialize `{0}` into string: {1}", jsonString, exception);
+ }
+
+ if (match == 0)
+ throw new InvalidDataException("The JSON string `" + jsonString +
+ "` cannot be deserialized into any schema defined.");
+ if (match > 1)
+ throw new InvalidDataException("The JSON string `" + jsonString +
+ "` incorrectly matches more than one schema (should be exactly one match): " +
+ string.Join(",", matchedTypes));
+
+ // deserialization is considered successful at this point if no exception has been thrown.
+ return newBigNumberish;
+ }
+ }
+
+ ///
+ /// Custom JSON converter for BigNumberish
+ ///
+ public class BigNumberishJsonConverter : JsonConverter
+ {
+ ///
+ /// To write the JSON string
+ ///
+ /// JSON writer
+ /// Object to be converted into a JSON string
+ /// JSON Serializer
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ writer.WriteRawValue((string)typeof(BigNumberish).GetMethod("ToJson").Invoke(value, null));
+ }
+
+ ///
+ /// To convert a JSON string into an object
+ ///
+ /// JSON reader
+ /// Object type
+ /// Existing value
+ /// JSON Serializer
+ /// The object converted from the JSON string
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue,
+ JsonSerializer serializer)
+ {
+ switch (reader.TokenType)
+ {
+ case JsonToken.String:
+ return new BigNumberish(Convert.ToString(reader.Value));
+ case JsonToken.Float:
+ return new BigNumberish(Convert.ToDecimal(reader.Value));
+ case JsonToken.StartObject:
+ return BigNumberish.FromJson(JObject.Load(reader).ToString(Formatting.None));
+ case JsonToken.StartArray:
+ return BigNumberish.FromJson(JArray.Load(reader).ToString(Formatting.None));
+ default:
+ return null;
+ }
+ }
+
+ ///
+ /// Check if the object can be converted
+ ///
+ /// Object type
+ /// True if the object can be converted
+ public override bool CanConvert(Type objectType)
+ {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs.meta b/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs.meta
new file mode 100644
index 000000000..d92baa008
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/BigNumberish.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b7de146751c9345868be38e3d5841a64
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs
new file mode 100644
index 000000000..6a0eac166
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs
@@ -0,0 +1,61 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// Response schema for the cancelOrder endpoint
+ ///
+ [DataContract(Name = "cancelOrders_200_response")]
+ public class CancelOrders200Response
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// result.
+ public CancelOrders200Response(CancelOrders200ResponseResult result = default)
+ {
+ Result = result;
+ }
+
+ ///
+ /// Gets or Sets Result
+ ///
+ [DataMember(Name = "result", EmitDefaultValue = false)]
+ public CancelOrders200ResponseResult Result { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CancelOrders200Response {\n");
+ sb.Append(" Result: ").Append(Result).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public virtual string ToJson()
+ {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs.meta
new file mode 100644
index 000000000..c2d5030b4
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200Response.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fc7669b5226d142269b1a5c89132bab2
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs
new file mode 100644
index 000000000..c1b6bd73a
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs
@@ -0,0 +1,85 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// CancelOrders200ResponseResult
+ ///
+ [DataContract(Name = "cancelOrders_200_response_result")]
+ public class CancelOrders200ResponseResult
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// Orders which failed to be cancelled.
+ /// Orders which are marked for cancellation but the cancellation cannot be guaranteed.
+ /// Orders which were successfully cancelled.
+ public CancelOrders200ResponseResult(
+ List failedCancellations = default,
+ List pendingCancellations = default, List successfulCancellations = default)
+ {
+ FailedCancellations = failedCancellations;
+ PendingCancellations = pendingCancellations;
+ SuccessfulCancellations = successfulCancellations;
+ }
+
+ ///
+ /// Orders which failed to be cancelled
+ ///
+ /// Orders which failed to be cancelled
+ [DataMember(Name = "failed_cancellations", EmitDefaultValue = false)]
+ public List FailedCancellations { get; set; }
+
+ ///
+ /// Orders which are marked for cancellation but the cancellation cannot be guaranteed
+ ///
+ /// Orders which are marked for cancellation but the cancellation cannot be guaranteed
+ [DataMember(Name = "pending_cancellations", EmitDefaultValue = false)]
+ public List PendingCancellations { get; set; }
+
+ ///
+ /// Orders which were successfully cancelled
+ ///
+ /// Orders which were successfully cancelled
+ [DataMember(Name = "successful_cancellations", EmitDefaultValue = false)]
+ public List SuccessfulCancellations { get; set; }
+
+ ///
+ /// Returns the string presentation of the object
+ ///
+ /// String presentation of the object
+ public override string ToString()
+ {
+ var sb = new StringBuilder();
+ sb.Append("class CancelOrders200ResponseResult {\n");
+ sb.Append(" FailedCancellations: ").Append(FailedCancellations).Append("\n");
+ sb.Append(" PendingCancellations: ").Append(PendingCancellations).Append("\n");
+ sb.Append(" SuccessfulCancellations: ").Append(SuccessfulCancellations).Append("\n");
+ sb.Append("}\n");
+ return sb.ToString();
+ }
+
+ ///
+ /// Returns the JSON string presentation of the object
+ ///
+ /// JSON string presentation of the object
+ public virtual string ToJson()
+ {
+ return JsonConvert.SerializeObject(this, Formatting.Indented);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs.meta
new file mode 100644
index 000000000..3c5e32f2c
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResult.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8d862e8ea4ed045cfb84e8abfefe3330
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResultFailedCancellationsInner.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResultFailedCancellationsInner.cs
new file mode 100644
index 000000000..a0669eaf2
--- /dev/null
+++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResultFailedCancellationsInner.cs
@@ -0,0 +1,88 @@
+/*
+ * TS SDK API
+ *
+ * running ts sdk as an api
+ *
+ * The version of the OpenAPI document: 1.0.0
+ * Contact: contact@immutable.com
+ * Generated by: https://github.com/openapitools/openapi-generator.git
+ */
+
+
+using System.Runtime.Serialization;
+using System.Text;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace Immutable.Orderbook.Model
+{
+ ///
+ /// CancelOrders200ResponseResultFailedCancellationsInner
+ ///
+ [DataContract(Name = "cancelOrders_200_response_result_failed_cancellations_inner")]
+ public class CancelOrders200ResponseResultFailedCancellationsInner
+ {
+ ///
+ /// Reason code indicating why the order failed to be cancelled
+ ///
+ /// Reason code indicating why the order failed to be cancelled
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum ReasonCodeEnum
+ {
+ ///
+ /// Enum FILLED for value: FILLED
+ ///
+ [EnumMember(Value = "FILLED")] FILLED
+ }
+
+ ///
+ /// Initializes a new instance of the