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 class. + /// + /// ID of the order which failed to be cancelled. + /// Reason code indicating why the order failed to be cancelled. + public CancelOrders200ResponseResultFailedCancellationsInner(string order = default, + ReasonCodeEnum? reasonCode = default) + { + Order = order; + ReasonCode = reasonCode; + } + + + /// + /// Reason code indicating why the order failed to be cancelled + /// + /// Reason code indicating why the order failed to be cancelled + [DataMember(Name = "reason_code", EmitDefaultValue = false)] + public ReasonCodeEnum? ReasonCode { get; set; } + + /// + /// ID of the order which failed to be cancelled + /// + /// ID of the order which failed to be cancelled + [DataMember(Name = "order", EmitDefaultValue = false)] + public string Order { 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 CancelOrders200ResponseResultFailedCancellationsInner {\n"); + sb.Append(" Order: ").Append(Order).Append("\n"); + sb.Append(" ReasonCode: ").Append(ReasonCode).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/CancelOrders200ResponseResultFailedCancellationsInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResultFailedCancellationsInner.cs.meta new file mode 100644 index 000000000..20d699277 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrders200ResponseResultFailedCancellationsInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6e2c085626e5943a6818481ea6f69df6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChain200Response.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChain200Response.cs new file mode 100644 index 000000000..f2e8061a1 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChain200Response.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 = "cancelOrdersOnChain_200_response")] + public class CancelOrdersOnChain200Response + { + /// + /// Initializes a new instance of the class. + /// + /// cancellationAction. + public CancelOrdersOnChain200Response(TransactionAction cancellationAction = default) + { + CancellationAction = cancellationAction; + } + + /// + /// Gets or Sets CancellationAction + /// + [DataMember(Name = "cancellationAction", EmitDefaultValue = false)] + public TransactionAction CancellationAction { 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 CancelOrdersOnChain200Response {\n"); + sb.Append(" CancellationAction: ").Append(CancellationAction).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/CancelOrdersOnChain200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChain200Response.cs.meta new file mode 100644 index 000000000..14cac85da --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChain200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 89d35a99e36cd494ea9bc328472db6bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChainRequest.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChainRequest.cs new file mode 100644 index 000000000..51380a742 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChainRequest.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; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// CancelOrdersOnChainRequest + /// + [DataContract(Name = "cancelOrdersOnChain_request")] + public class CancelOrdersOnChainRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CancelOrdersOnChainRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// orderIds (required). + /// accountAddress (required). + public CancelOrdersOnChainRequest(List orderIds = default, string accountAddress = default) + { + // to ensure "orderIds" is required (not null) + if (orderIds == null) + throw new ArgumentNullException( + "orderIds is a required property for CancelOrdersOnChainRequest and cannot be null"); + OrderIds = orderIds; + // to ensure "accountAddress" is required (not null) + if (accountAddress == null) + throw new ArgumentNullException( + "accountAddress is a required property for CancelOrdersOnChainRequest and cannot be null"); + AccountAddress = accountAddress; + } + + /// + /// Gets or Sets OrderIds + /// + [DataMember(Name = "orderIds", IsRequired = true, EmitDefaultValue = true)] + public List OrderIds { get; set; } + + /// + /// Gets or Sets AccountAddress + /// + [DataMember(Name = "accountAddress", IsRequired = true, EmitDefaultValue = true)] + public string AccountAddress { 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 CancelOrdersOnChainRequest {\n"); + sb.Append(" OrderIds: ").Append(OrderIds).Append("\n"); + sb.Append(" AccountAddress: ").Append(AccountAddress).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/CancelOrdersOnChainRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChainRequest.cs.meta new file mode 100644 index 000000000..7b57e8e3a --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersOnChainRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b57269809a6274249a4a98ca18ecf52b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CancelOrdersRequest.cs b/src/Packages/Orderbook/Runtime/Model/CancelOrdersRequest.cs new file mode 100644 index 000000000..9ef25d946 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersRequest.cs @@ -0,0 +1,102 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// CancelOrdersRequest + /// + [DataContract(Name = "cancelOrders_request")] + public class CancelOrdersRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CancelOrdersRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// orderIds (required). + /// accountAddress (required). + /// signature (required). + public CancelOrdersRequest(List orderIds = default, string accountAddress = default, + string signature = default) + { + // to ensure "orderIds" is required (not null) + if (orderIds == null) + throw new ArgumentNullException( + "orderIds is a required property for CancelOrdersRequest and cannot be null"); + OrderIds = orderIds; + // to ensure "accountAddress" is required (not null) + if (accountAddress == null) + throw new ArgumentNullException( + "accountAddress is a required property for CancelOrdersRequest and cannot be null"); + AccountAddress = accountAddress; + // to ensure "signature" is required (not null) + if (signature == null) + throw new ArgumentNullException( + "signature is a required property for CancelOrdersRequest and cannot be null"); + Signature = signature; + } + + /// + /// Gets or Sets OrderIds + /// + [DataMember(Name = "orderIds", IsRequired = true, EmitDefaultValue = true)] + public List OrderIds { get; set; } + + /// + /// Gets or Sets AccountAddress + /// + [DataMember(Name = "accountAddress", IsRequired = true, EmitDefaultValue = true)] + public string AccountAddress { get; set; } + + /// + /// Gets or Sets Signature + /// + [DataMember(Name = "signature", IsRequired = true, EmitDefaultValue = true)] + public string Signature { 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 CancelOrdersRequest {\n"); + sb.Append(" OrderIds: ").Append(OrderIds).Append("\n"); + sb.Append(" AccountAddress: ").Append(AccountAddress).Append("\n"); + sb.Append(" Signature: ").Append(Signature).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/CancelOrdersRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelOrdersRequest.cs.meta new file mode 100644 index 000000000..5e0161af9 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelOrdersRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf20ce4ff601445b58361eb3b5e80aa0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CancellationType.cs b/src/Packages/Orderbook/Runtime/Model/CancellationType.cs new file mode 100644 index 000000000..e03ec6ba3 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancellationType.cs @@ -0,0 +1,40 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + /// + /// Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + [JsonConverter(typeof(StringEnumConverter))] + public enum CancellationType + { + /// + /// Enum ONCHAIN for value: ON_CHAIN + /// + [EnumMember(Value = "ON_CHAIN")] ONCHAIN, + + /// + /// Enum OFFCHAIN for value: OFF_CHAIN + /// + [EnumMember(Value = "OFF_CHAIN")] OFFCHAIN, + + /// + /// Enum UNDERFUNDED for value: UNDERFUNDED + /// + [EnumMember(Value = "UNDERFUNDED")] UNDERFUNDED + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/CancellationType.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancellationType.cs.meta new file mode 100644 index 000000000..41299ba81 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancellationType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bd5152b03b95f415e8884fb12768515f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs b/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs new file mode 100644 index 000000000..203d0532f --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs @@ -0,0 +1,40 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + /// + /// Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account + [JsonConverter(typeof(StringEnumConverter))] + public enum CancelledOrderStatusCancellationType + { + /// + /// Enum ONCHAIN for value: ON_CHAIN + /// + [EnumMember(Value = "ON_CHAIN")] ONCHAIN, + + /// + /// Enum OFFCHAIN for value: OFF_CHAIN + /// + [EnumMember(Value = "OFF_CHAIN")] OFFCHAIN, + + /// + /// Enum UNDERFUNDED for value: UNDERFUNDED + /// + [EnumMember(Value = "UNDERFUNDED")] UNDERFUNDED + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs.meta b/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs.meta new file mode 100644 index 000000000..4277fccb6 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CancelledOrderStatusCancellationType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9a623acad53b341d09b70d91c7a86557 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CreateListing200Response.cs b/src/Packages/Orderbook/Runtime/Model/CreateListing200Response.cs new file mode 100644 index 000000000..d917035af --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CreateListing200Response.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 +{ + /// + /// The response schema for the create listing endpoint + /// + [DataContract(Name = "createListing_200_response")] + public class CreateListing200Response + { + /// + /// Initializes a new instance of the class. + /// + /// result. + public CreateListing200Response(Order result = default) + { + Result = result; + } + + /// + /// Gets or Sets Result + /// + [DataMember(Name = "result", EmitDefaultValue = false)] + public Order 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 CreateListing200Response {\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/CreateListing200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/CreateListing200Response.cs.meta new file mode 100644 index 000000000..8f5f123b2 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CreateListing200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ef9d6781deebb4009a36ab4b0df18a26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/CreateListingRequest.cs b/src/Packages/Orderbook/Runtime/Model/CreateListingRequest.cs new file mode 100644 index 000000000..931892819 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CreateListingRequest.cs @@ -0,0 +1,115 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// CreateListingRequest + /// + [DataContract(Name = "createListing_request")] + public class CreateListingRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected CreateListingRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// makerFees (required). + /// orderComponents (required). + /// orderHash (required). + /// orderSignature (required). + public CreateListingRequest(List makerFees = default, OrderComponents orderComponents = default, + string orderHash = default, string orderSignature = default) + { + // to ensure "makerFees" is required (not null) + if (makerFees == null) + throw new ArgumentNullException( + "makerFees is a required property for CreateListingRequest and cannot be null"); + MakerFees = makerFees; + // to ensure "orderComponents" is required (not null) + if (orderComponents == null) + throw new ArgumentNullException( + "orderComponents is a required property for CreateListingRequest and cannot be null"); + OrderComponents = orderComponents; + // to ensure "orderHash" is required (not null) + if (orderHash == null) + throw new ArgumentNullException( + "orderHash is a required property for CreateListingRequest and cannot be null"); + OrderHash = orderHash; + // to ensure "orderSignature" is required (not null) + if (orderSignature == null) + throw new ArgumentNullException( + "orderSignature is a required property for CreateListingRequest and cannot be null"); + OrderSignature = orderSignature; + } + + /// + /// Gets or Sets MakerFees + /// + [DataMember(Name = "makerFees", IsRequired = true, EmitDefaultValue = true)] + public List MakerFees { get; set; } + + /// + /// Gets or Sets OrderComponents + /// + [DataMember(Name = "orderComponents", IsRequired = true, EmitDefaultValue = true)] + public OrderComponents OrderComponents { get; set; } + + /// + /// Gets or Sets OrderHash + /// + [DataMember(Name = "orderHash", IsRequired = true, EmitDefaultValue = true)] + public string OrderHash { get; set; } + + /// + /// Gets or Sets OrderSignature + /// + [DataMember(Name = "orderSignature", IsRequired = true, EmitDefaultValue = true)] + public string OrderSignature { 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 CreateListingRequest {\n"); + sb.Append(" MakerFees: ").Append(MakerFees).Append("\n"); + sb.Append(" OrderComponents: ").Append(OrderComponents).Append("\n"); + sb.Append(" OrderHash: ").Append(OrderHash).Append("\n"); + sb.Append(" OrderSignature: ").Append(OrderSignature).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/CreateListingRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/CreateListingRequest.cs.meta new file mode 100644 index 000000000..12622defd --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/CreateListingRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7b0115480bf25419bbe899925f73fd6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/ERC1155Item.cs b/src/Packages/Orderbook/Runtime/Model/ERC1155Item.cs new file mode 100644 index 000000000..154574399 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC1155Item.cs @@ -0,0 +1,122 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// ERC1155Item + /// + [DataContract(Name = "ERC1155Item")] + public class ERC1155Item + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum ERC1155 for value: ERC1155 + /// + [EnumMember(Value = "ERC1155")] ERC1155 + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ERC1155Item() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// contractAddress (required). + /// tokenId (required). + /// type (required). + public ERC1155Item(string amount = default, string contractAddress = default, string tokenId = default, + TypeEnum type = default) + { + // to ensure "amount" is required (not null) + if (amount == null) + throw new ArgumentNullException("amount is a required property for ERC1155Item and cannot be null"); + Amount = amount; + // to ensure "contractAddress" is required (not null) + if (contractAddress == null) + throw new ArgumentNullException( + "contractAddress is a required property for ERC1155Item and cannot be null"); + ContractAddress = contractAddress; + // to ensure "tokenId" is required (not null) + if (tokenId == null) + throw new ArgumentNullException("tokenId is a required property for ERC1155Item and cannot be null"); + TokenId = tokenId; + Type = type; + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)] + public string Amount { get; set; } + + /// + /// Gets or Sets ContractAddress + /// + [DataMember(Name = "contractAddress", IsRequired = true, EmitDefaultValue = true)] + public string ContractAddress { get; set; } + + /// + /// Gets or Sets TokenId + /// + [DataMember(Name = "tokenId", IsRequired = true, EmitDefaultValue = true)] + public string TokenId { 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 ERC1155Item {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ContractAddress: ").Append(ContractAddress).Append("\n"); + sb.Append(" TokenId: ").Append(TokenId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/ERC1155Item.cs.meta b/src/Packages/Orderbook/Runtime/Model/ERC1155Item.cs.meta new file mode 100644 index 000000000..dd1a96c8e --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC1155Item.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 483b38137a563405abde59ec61a8ca4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/ERC20Item.cs b/src/Packages/Orderbook/Runtime/Model/ERC20Item.cs new file mode 100644 index 000000000..8ef1f9c9d --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC20Item.cs @@ -0,0 +1,109 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// ERC20Item + /// + [DataContract(Name = "ERC20Item")] + public class ERC20Item + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum ERC20 for value: ERC20 + /// + [EnumMember(Value = "ERC20")] ERC20 + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ERC20Item() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// contractAddress (required). + /// type (required). + public ERC20Item(string amount = default, string contractAddress = default, TypeEnum type = default) + { + // to ensure "amount" is required (not null) + if (amount == null) + throw new ArgumentNullException("amount is a required property for ERC20Item and cannot be null"); + Amount = amount; + // to ensure "contractAddress" is required (not null) + if (contractAddress == null) + throw new ArgumentNullException( + "contractAddress is a required property for ERC20Item and cannot be null"); + ContractAddress = contractAddress; + Type = type; + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)] + public string Amount { get; set; } + + /// + /// Gets or Sets ContractAddress + /// + [DataMember(Name = "contractAddress", IsRequired = true, EmitDefaultValue = true)] + public string ContractAddress { 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 ERC20Item {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" ContractAddress: ").Append(ContractAddress).Append("\n"); + sb.Append(" Type: ").Append(Type).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/ERC20Item.cs.meta b/src/Packages/Orderbook/Runtime/Model/ERC20Item.cs.meta new file mode 100644 index 000000000..48e23ab46 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC20Item.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 586567b8cf1b24b34a2d1ae613fe6b84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/ERC721Item.cs b/src/Packages/Orderbook/Runtime/Model/ERC721Item.cs new file mode 100644 index 000000000..a75fd8825 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC721Item.cs @@ -0,0 +1,109 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// ERC721Item + /// + [DataContract(Name = "ERC721Item")] + public class ERC721Item + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum ERC721 for value: ERC721 + /// + [EnumMember(Value = "ERC721")] ERC721 + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected ERC721Item() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// contractAddress (required). + /// tokenId (required). + /// type (required). + public ERC721Item(string contractAddress = default, string tokenId = default, TypeEnum type = default) + { + // to ensure "contractAddress" is required (not null) + if (contractAddress == null) + throw new ArgumentNullException( + "contractAddress is a required property for ERC721Item and cannot be null"); + ContractAddress = contractAddress; + // to ensure "tokenId" is required (not null) + if (tokenId == null) + throw new ArgumentNullException("tokenId is a required property for ERC721Item and cannot be null"); + TokenId = tokenId; + Type = type; + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets ContractAddress + /// + [DataMember(Name = "contractAddress", IsRequired = true, EmitDefaultValue = true)] + public string ContractAddress { get; set; } + + /// + /// Gets or Sets TokenId + /// + [DataMember(Name = "tokenId", IsRequired = true, EmitDefaultValue = true)] + public string TokenId { 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 ERC721Item {\n"); + sb.Append(" ContractAddress: ").Append(ContractAddress).Append("\n"); + sb.Append(" TokenId: ").Append(TokenId).Append("\n"); + sb.Append(" Type: ").Append(Type).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/ERC721Item.cs.meta b/src/Packages/Orderbook/Runtime/Model/ERC721Item.cs.meta new file mode 100644 index 000000000..e24014598 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ERC721Item.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3aa71d7af83242b1b6b5755a090a3ce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/Fee.cs b/src/Packages/Orderbook/Runtime/Model/Fee.cs new file mode 100644 index 000000000..d91f98001 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/Fee.cs @@ -0,0 +1,79 @@ +/* + * 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 +{ + /// + /// Fee + /// + [DataContract(Name = "Fee")] + public class Fee + { + /// + /// Initializes a new instance of the class. + /// + /// amount. + /// recipientAddress. + /// type. + public Fee(string amount = default, string recipientAddress = default, FeeType? type = default) + { + Amount = amount; + RecipientAddress = recipientAddress; + Type = type; + } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public FeeType? Type { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", EmitDefaultValue = false)] + public string Amount { get; set; } + + /// + /// Gets or Sets RecipientAddress + /// + [DataMember(Name = "recipientAddress", EmitDefaultValue = false)] + public string RecipientAddress { 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 Fee {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" RecipientAddress: ").Append(RecipientAddress).Append("\n"); + sb.Append(" Type: ").Append(Type).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/Fee.cs.meta b/src/Packages/Orderbook/Runtime/Model/Fee.cs.meta new file mode 100644 index 000000000..077f13ff2 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/Fee.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5a991b2f669d4f43ae16036f242b852 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/FeeType.cs b/src/Packages/Orderbook/Runtime/Model/FeeType.cs new file mode 100644 index 000000000..f32093ffa --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FeeType.cs @@ -0,0 +1,46 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Defines FeeType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum FeeType + { + /// + /// Enum MAKERECOSYSTEM for value: MAKER_ECOSYSTEM + /// + [EnumMember(Value = "MAKER_ECOSYSTEM")] + MAKERECOSYSTEM, + + /// + /// Enum TAKERECOSYSTEM for value: TAKER_ECOSYSTEM + /// + [EnumMember(Value = "TAKER_ECOSYSTEM")] + TAKERECOSYSTEM, + + /// + /// Enum PROTOCOL for value: PROTOCOL + /// + [EnumMember(Value = "PROTOCOL")] PROTOCOL, + + /// + /// Enum ROYALTY for value: ROYALTY + /// + [EnumMember(Value = "ROYALTY")] ROYALTY + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/FeeType.cs.meta b/src/Packages/Orderbook/Runtime/Model/FeeType.cs.meta new file mode 100644 index 000000000..1aef1bc53 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FeeType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78ba01dd4ab63437fab78e9c0a963c74 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/FeeValue.cs b/src/Packages/Orderbook/Runtime/Model/FeeValue.cs new file mode 100644 index 000000000..d680bbe86 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FeeValue.cs @@ -0,0 +1,86 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// FeeValue + /// + [DataContract(Name = "FeeValue")] + public class FeeValue + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FeeValue() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// recipientAddress (required). + public FeeValue(string amount = default, string recipientAddress = default) + { + // to ensure "amount" is required (not null) + if (amount == null) + throw new ArgumentNullException("amount is a required property for FeeValue and cannot be null"); + Amount = amount; + // to ensure "recipientAddress" is required (not null) + if (recipientAddress == null) + throw new ArgumentNullException( + "recipientAddress is a required property for FeeValue and cannot be null"); + RecipientAddress = recipientAddress; + } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)] + public string Amount { get; set; } + + /// + /// Gets or Sets RecipientAddress + /// + [DataMember(Name = "recipientAddress", IsRequired = true, EmitDefaultValue = true)] + public string RecipientAddress { 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 FeeValue {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" RecipientAddress: ").Append(RecipientAddress).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/FeeValue.cs.meta b/src/Packages/Orderbook/Runtime/Model/FeeValue.cs.meta new file mode 100644 index 000000000..a0223b9cc --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FeeValue.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fd6491af30b34978b43b5f105da8df2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/FulfillOrder200Response.cs b/src/Packages/Orderbook/Runtime/Model/FulfillOrder200Response.cs new file mode 100644 index 000000000..d9d37e023 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrder200Response.cs @@ -0,0 +1,89 @@ +/* + * 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 +{ + /// + /// Response schema for the fulfillOrder endpoint + /// + [DataContract(Name = "fulfillOrder_200_response")] + public class FulfillOrder200Response + { + /// + /// Initializes a new instance of the class. + /// + /// actions. + /// + /// User MUST submit the fulfillment transaction before the expiration Submitting after the + /// expiration will result in a on chain revert. + /// + /// order. + public FulfillOrder200Response(List actions = default, string expiration = default, + Order order = default) + { + Actions = actions; + Expiration = expiration; + Order = order; + } + + /// + /// Gets or Sets Actions + /// + [DataMember(Name = "actions", EmitDefaultValue = false)] + public List Actions { get; set; } + + /// + /// User MUST submit the fulfillment transaction before the expiration Submitting after the expiration will result in a + /// on chain revert + /// + /// + /// User MUST submit the fulfillment transaction before the expiration Submitting after the expiration will result + /// in a on chain revert + /// + [DataMember(Name = "expiration", EmitDefaultValue = false)] + public string Expiration { get; set; } + + /// + /// Gets or Sets Order + /// + [DataMember(Name = "order", EmitDefaultValue = false)] + public Order Order { 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 FulfillOrder200Response {\n"); + sb.Append(" Actions: ").Append(Actions).Append("\n"); + sb.Append(" Expiration: ").Append(Expiration).Append("\n"); + sb.Append(" Order: ").Append(Order).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/FulfillOrder200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/FulfillOrder200Response.cs.meta new file mode 100644 index 000000000..c0ee2cf80 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrder200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad9c3c5fdafdc465dbf0d3e6e533d153 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequest.cs b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequest.cs new file mode 100644 index 000000000..568f33ac9 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequest.cs @@ -0,0 +1,115 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// FulfillOrderRequest + /// + [DataContract(Name = "fulfillOrder_request")] + public class FulfillOrderRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FulfillOrderRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// listingId (required). + /// takerAddress (required). + /// takerFees (required). + /// amountToFill. + public FulfillOrderRequest(string listingId = default, string takerAddress = default, + List takerFees = default, string amountToFill = default) + { + // to ensure "listingId" is required (not null) + if (listingId == null) + throw new ArgumentNullException( + "listingId is a required property for FulfillOrderRequest and cannot be null"); + ListingId = listingId; + // to ensure "takerAddress" is required (not null) + if (takerAddress == null) + throw new ArgumentNullException( + "takerAddress is a required property for FulfillOrderRequest and cannot be null"); + TakerAddress = takerAddress; + // to ensure "takerFees" is required (not null) + if (takerFees == null) + throw new ArgumentNullException( + "takerFees is a required property for FulfillOrderRequest and cannot be null"); + TakerFees = takerFees; + AmountToFill = amountToFill; + } + + /// + /// listingId + /// + /// listingId + [DataMember(Name = "listingId", IsRequired = true, EmitDefaultValue = true)] + public string ListingId { get; set; } + + /// + /// takerAddress + /// + /// takerAddress + [DataMember(Name = "takerAddress", IsRequired = true, EmitDefaultValue = true)] + public string TakerAddress { get; set; } + + /// + /// takerFees + /// + /// takerFees + [DataMember(Name = "takerFees", IsRequired = true, EmitDefaultValue = true)] + public List TakerFees { get; set; } + + /// + /// amountToFill + /// + /// amountToFill + [DataMember(Name = "amountToFill", EmitDefaultValue = false)] + public string AmountToFill { 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 FulfillOrderRequest {\n"); + sb.Append(" ListingId: ").Append(ListingId).Append("\n"); + sb.Append(" TakerAddress: ").Append(TakerAddress).Append("\n"); + sb.Append(" TakerFees: ").Append(TakerFees).Append("\n"); + sb.Append(" AmountToFill: ").Append(AmountToFill).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/FulfillOrderRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequest.cs.meta new file mode 100644 index 000000000..d7371e32f --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 2f22f517b28374160bb19b7e54e32f13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequestTakerFeesInner.cs b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequestTakerFeesInner.cs new file mode 100644 index 000000000..ac6e9015f --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequestTakerFeesInner.cs @@ -0,0 +1,87 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// FulfillOrderRequestTakerFeesInner + /// + [DataContract(Name = "fulfillOrder_request_takerFees_inner")] + public class FulfillOrderRequestTakerFeesInner + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected FulfillOrderRequestTakerFeesInner() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// recipientAddress (required). + public FulfillOrderRequestTakerFeesInner(string amount = default, string recipientAddress = default) + { + // to ensure "amount" is required (not null) + if (amount == null) + throw new ArgumentNullException( + "amount is a required property for FulfillOrderRequestTakerFeesInner and cannot be null"); + Amount = amount; + // to ensure "recipientAddress" is required (not null) + if (recipientAddress == null) + throw new ArgumentNullException( + "recipientAddress is a required property for FulfillOrderRequestTakerFeesInner and cannot be null"); + RecipientAddress = recipientAddress; + } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)] + public string Amount { get; set; } + + /// + /// Gets or Sets RecipientAddress + /// + [DataMember(Name = "recipientAddress", IsRequired = true, EmitDefaultValue = true)] + public string RecipientAddress { 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 FulfillOrderRequestTakerFeesInner {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" RecipientAddress: ").Append(RecipientAddress).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/FulfillOrderRequestTakerFeesInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequestTakerFeesInner.cs.meta new file mode 100644 index 000000000..544f99f0d --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/FulfillOrderRequestTakerFeesInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70909b7d7976749d4aad34c35290c8ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/ItemType.cs b/src/Packages/Orderbook/Runtime/Model/ItemType.cs new file mode 100644 index 000000000..784e14415 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ItemType.cs @@ -0,0 +1,54 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Defines ItemType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ItemType + { + /// + /// Enum _0 for value: 0 + /// + [EnumMember(Value = "0")] _0, + + /// + /// Enum _1 for value: 1 + /// + [EnumMember(Value = "1")] _1, + + /// + /// Enum _2 for value: 2 + /// + [EnumMember(Value = "2")] _2, + + /// + /// Enum _3 for value: 3 + /// + [EnumMember(Value = "3")] _3, + + /// + /// Enum _4 for value: 4 + /// + [EnumMember(Value = "4")] _4, + + /// + /// Enum _5 for value: 5 + /// + [EnumMember(Value = "5")] _5 + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/ItemType.cs.meta b/src/Packages/Orderbook/Runtime/Model/ItemType.cs.meta new file mode 100644 index 000000000..c11f9d537 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/ItemType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58c81791aed204308a98ade29aff6fa5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/NativeItem.cs b/src/Packages/Orderbook/Runtime/Model/NativeItem.cs new file mode 100644 index 000000000..8f69c1720 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/NativeItem.cs @@ -0,0 +1,96 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// NativeItem + /// + [DataContract(Name = "NativeItem")] + public class NativeItem + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum NATIVE for value: NATIVE + /// + [EnumMember(Value = "NATIVE")] NATIVE + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected NativeItem() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// amount (required). + /// type (required). + public NativeItem(string amount = default, TypeEnum type = default) + { + // to ensure "amount" is required (not null) + if (amount == null) + throw new ArgumentNullException("amount is a required property for NativeItem and cannot be null"); + Amount = amount; + Type = type; + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets Amount + /// + [DataMember(Name = "amount", IsRequired = true, EmitDefaultValue = true)] + public string Amount { 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 NativeItem {\n"); + sb.Append(" Amount: ").Append(Amount).Append("\n"); + sb.Append(" Type: ").Append(Type).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/NativeItem.cs.meta b/src/Packages/Orderbook/Runtime/Model/NativeItem.cs.meta new file mode 100644 index 000000000..152816b9c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/NativeItem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67a7b279db915476ab0de2d613d99d32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/Order.cs b/src/Packages/Orderbook/Runtime/Model/Order.cs new file mode 100644 index 000000000..c4654aa6b --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/Order.cs @@ -0,0 +1,256 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Order + /// + [DataContract(Name = "Order")] + public class Order + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum LISTING for value: LISTING + /// + [EnumMember(Value = "LISTING")] LISTING + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected Order() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// accountAddress. + /// buy. + /// chain. + /// createdAt. + /// Time after which the Order is expired. + /// fees. + /// fillStatus. + /// id (required). + /// orderHash (required). + /// protocolData. + /// salt. + /// sell (required). + /// signature (required). + /// Time after which the Order is considered active (required). + /// status (required). + /// type (required). + /// updatedAt (required). + public Order(string accountAddress = default, List buy = default, + OrderChain chain = default, string createdAt = default, string endAt = default, List fees = default, + OrderFillStatus fillStatus = default, string id = default, string orderHash = default, + OrderProtocolData protocolData = default, string salt = default, + List sell = default, string signature = default, string startAt = default, + OrderStatus status = default, TypeEnum type = default, string updatedAt = default) + { + // to ensure "id" is required (not null) + if (id == null) throw new ArgumentNullException("id is a required property for Order and cannot be null"); + Id = id; + // to ensure "orderHash" is required (not null) + if (orderHash == null) + throw new ArgumentNullException("orderHash is a required property for Order and cannot be null"); + OrderHash = orderHash; + // to ensure "sell" is required (not null) + if (sell == null) + throw new ArgumentNullException("sell is a required property for Order and cannot be null"); + Sell = sell; + // to ensure "signature" is required (not null) + if (signature == null) + throw new ArgumentNullException("signature is a required property for Order and cannot be null"); + Signature = signature; + // to ensure "startAt" is required (not null) + if (startAt == null) + throw new ArgumentNullException("startAt is a required property for Order and cannot be null"); + StartAt = startAt; + // to ensure "status" is required (not null) + if (status == null) + throw new ArgumentNullException("status is a required property for Order and cannot be null"); + Status = status; + Type = type; + // to ensure "updatedAt" is required (not null) + if (updatedAt == null) + throw new ArgumentNullException("updatedAt is a required property for Order and cannot be null"); + UpdatedAt = updatedAt; + AccountAddress = accountAddress; + Buy = buy; + Chain = chain; + CreatedAt = createdAt; + EndAt = endAt; + Fees = fees; + FillStatus = fillStatus; + ProtocolData = protocolData; + Salt = salt; + } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets AccountAddress + /// + [DataMember(Name = "accountAddress", EmitDefaultValue = false)] + public string AccountAddress { get; set; } + + /// + /// Gets or Sets Buy + /// + [DataMember(Name = "buy", EmitDefaultValue = false)] + public List Buy { get; set; } + + /// + /// Gets or Sets Chain + /// + [DataMember(Name = "chain", EmitDefaultValue = false)] + public OrderChain Chain { get; set; } + + /// + /// Gets or Sets CreatedAt + /// + [DataMember(Name = "createdAt", EmitDefaultValue = false)] + public string CreatedAt { get; set; } + + /// + /// Time after which the Order is expired + /// + /// Time after which the Order is expired + [DataMember(Name = "endAt", EmitDefaultValue = false)] + public string EndAt { get; set; } + + /// + /// Gets or Sets Fees + /// + [DataMember(Name = "fees", EmitDefaultValue = false)] + public List Fees { get; set; } + + /// + /// Gets or Sets FillStatus + /// + [DataMember(Name = "fillStatus", EmitDefaultValue = false)] + public OrderFillStatus FillStatus { get; set; } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)] + public string Id { get; set; } + + /// + /// Gets or Sets OrderHash + /// + [DataMember(Name = "orderHash", IsRequired = true, EmitDefaultValue = true)] + public string OrderHash { get; set; } + + /// + /// Gets or Sets ProtocolData + /// + [DataMember(Name = "protocolData", EmitDefaultValue = false)] + public OrderProtocolData ProtocolData { get; set; } + + /// + /// Gets or Sets Salt + /// + [DataMember(Name = "salt", EmitDefaultValue = false)] + public string Salt { get; set; } + + /// + /// Gets or Sets Sell + /// + [DataMember(Name = "sell", IsRequired = true, EmitDefaultValue = true)] + public List Sell { get; set; } + + /// + /// Gets or Sets Signature + /// + [DataMember(Name = "signature", IsRequired = true, EmitDefaultValue = true)] + public string Signature { get; set; } + + /// + /// Time after which the Order is considered active + /// + /// Time after which the Order is considered active + [DataMember(Name = "startAt", IsRequired = true, EmitDefaultValue = true)] + public string StartAt { get; set; } + + /// + /// Gets or Sets Status + /// + [DataMember(Name = "status", IsRequired = true, EmitDefaultValue = true)] + public OrderStatus Status { get; set; } + + /// + /// Gets or Sets UpdatedAt + /// + [DataMember(Name = "updatedAt", IsRequired = true, EmitDefaultValue = true)] + public string UpdatedAt { 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 Order {\n"); + sb.Append(" AccountAddress: ").Append(AccountAddress).Append("\n"); + sb.Append(" Buy: ").Append(Buy).Append("\n"); + sb.Append(" Chain: ").Append(Chain).Append("\n"); + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); + sb.Append(" EndAt: ").Append(EndAt).Append("\n"); + sb.Append(" Fees: ").Append(Fees).Append("\n"); + sb.Append(" FillStatus: ").Append(FillStatus).Append("\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" OrderHash: ").Append(OrderHash).Append("\n"); + sb.Append(" ProtocolData: ").Append(ProtocolData).Append("\n"); + sb.Append(" Salt: ").Append(Salt).Append("\n"); + sb.Append(" Sell: ").Append(Sell).Append("\n"); + sb.Append(" Signature: ").Append(Signature).Append("\n"); + sb.Append(" StartAt: ").Append(StartAt).Append("\n"); + sb.Append(" Status: ").Append(Status).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" UpdatedAt: ").Append(UpdatedAt).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/Order.cs.meta b/src/Packages/Orderbook/Runtime/Model/Order.cs.meta new file mode 100644 index 000000000..414abfd0a --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/Order.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7dcab53894a3f48649f8d9112442b934 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderChain.cs b/src/Packages/Orderbook/Runtime/Model/OrderChain.cs new file mode 100644 index 000000000..2ba65536f --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderChain.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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// OrderChain + /// + [DataContract(Name = "Order_chain")] + public class OrderChain + { + /// + /// Initializes a new instance of the class. + /// + /// id. + /// name. + public OrderChain(string id = default, string name = default) + { + Id = id; + Name = name; + } + + /// + /// Gets or Sets Id + /// + [DataMember(Name = "id", EmitDefaultValue = false)] + public string Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { 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 OrderChain {\n"); + sb.Append(" Id: ").Append(Id).Append("\n"); + sb.Append(" Name: ").Append(Name).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/OrderChain.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderChain.cs.meta new file mode 100644 index 000000000..39e8b14cb --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderChain.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 263470d9f9dc64d90b6eb79795f70746 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderComponents.cs b/src/Packages/Orderbook/Runtime/Model/OrderComponents.cs new file mode 100644 index 000000000..610bfeb6a --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponents.cs @@ -0,0 +1,215 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// OrderComponents + /// + [DataContract(Name = "OrderComponents")] + public class OrderComponents + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected OrderComponents() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// conduitKey (required). + /// consideration (required). + /// endTime (required). + /// offer (required). + /// offerer (required). + /// orderType (required). + /// salt (required). + /// startTime (required). + /// totalOriginalConsiderationItems (required). + /// zone (required). + /// zoneHash (required). + /// counter (required). + public OrderComponents(string conduitKey = default, + List consideration = default, string endTime = default, + List offer = default, string offerer = default, OrderType orderType = default, + string salt = default, string startTime = default, string totalOriginalConsiderationItems = default, + string zone = default, string zoneHash = default, string counter = default) + { + // to ensure "conduitKey" is required (not null) + if (conduitKey == null) + throw new ArgumentNullException( + "conduitKey is a required property for OrderComponents and cannot be null"); + ConduitKey = conduitKey; + // to ensure "consideration" is required (not null) + if (consideration == null) + throw new ArgumentNullException( + "consideration is a required property for OrderComponents and cannot be null"); + Consideration = consideration; + // to ensure "endTime" is required (not null) + if (endTime == null) + throw new ArgumentNullException( + "endTime is a required property for OrderComponents and cannot be null"); + EndTime = endTime; + // to ensure "offer" is required (not null) + if (offer == null) + throw new ArgumentNullException("offer is a required property for OrderComponents and cannot be null"); + Offer = offer; + // to ensure "offerer" is required (not null) + if (offerer == null) + throw new ArgumentNullException( + "offerer is a required property for OrderComponents and cannot be null"); + Offerer = offerer; + OrderType = orderType; + // to ensure "salt" is required (not null) + if (salt == null) + throw new ArgumentNullException("salt is a required property for OrderComponents and cannot be null"); + Salt = salt; + // to ensure "startTime" is required (not null) + if (startTime == null) + throw new ArgumentNullException( + "startTime is a required property for OrderComponents and cannot be null"); + StartTime = startTime; + // to ensure "totalOriginalConsiderationItems" is required (not null) + if (totalOriginalConsiderationItems == null) + throw new ArgumentNullException( + "totalOriginalConsiderationItems is a required property for OrderComponents and cannot be null"); + TotalOriginalConsiderationItems = totalOriginalConsiderationItems; + // to ensure "zone" is required (not null) + if (zone == null) + throw new ArgumentNullException("zone is a required property for OrderComponents and cannot be null"); + Zone = zone; + // to ensure "zoneHash" is required (not null) + if (zoneHash == null) + throw new ArgumentNullException( + "zoneHash is a required property for OrderComponents and cannot be null"); + ZoneHash = zoneHash; + // to ensure "counter" is required (not null) + if (counter == null) + throw new ArgumentNullException( + "counter is a required property for OrderComponents and cannot be null"); + Counter = counter; + } + + /// + /// Gets or Sets OrderType + /// + [DataMember(Name = "orderType", IsRequired = true, EmitDefaultValue = true)] + public OrderType OrderType { get; set; } + + /// + /// Gets or Sets ConduitKey + /// + [DataMember(Name = "conduitKey", IsRequired = true, EmitDefaultValue = true)] + public string ConduitKey { get; set; } + + /// + /// Gets or Sets Consideration + /// + [DataMember(Name = "consideration", IsRequired = true, EmitDefaultValue = true)] + public List Consideration { get; set; } + + /// + /// Gets or Sets EndTime + /// + [DataMember(Name = "endTime", IsRequired = true, EmitDefaultValue = true)] + public string EndTime { get; set; } + + /// + /// Gets or Sets Offer + /// + [DataMember(Name = "offer", IsRequired = true, EmitDefaultValue = true)] + public List Offer { get; set; } + + /// + /// Gets or Sets Offerer + /// + [DataMember(Name = "offerer", IsRequired = true, EmitDefaultValue = true)] + public string Offerer { get; set; } + + /// + /// Gets or Sets Salt + /// + [DataMember(Name = "salt", IsRequired = true, EmitDefaultValue = true)] + public string Salt { get; set; } + + /// + /// Gets or Sets StartTime + /// + [DataMember(Name = "startTime", IsRequired = true, EmitDefaultValue = true)] + public string StartTime { get; set; } + + /// + /// Gets or Sets TotalOriginalConsiderationItems + /// + [DataMember(Name = "totalOriginalConsiderationItems", IsRequired = true, EmitDefaultValue = true)] + public string TotalOriginalConsiderationItems { get; set; } + + /// + /// Gets or Sets Zone + /// + [DataMember(Name = "zone", IsRequired = true, EmitDefaultValue = true)] + public string Zone { get; set; } + + /// + /// Gets or Sets ZoneHash + /// + [DataMember(Name = "zoneHash", IsRequired = true, EmitDefaultValue = true)] + public string ZoneHash { get; set; } + + /// + /// Gets or Sets Counter + /// + [DataMember(Name = "counter", IsRequired = true, EmitDefaultValue = true)] + public string Counter { 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 OrderComponents {\n"); + sb.Append(" ConduitKey: ").Append(ConduitKey).Append("\n"); + sb.Append(" Consideration: ").Append(Consideration).Append("\n"); + sb.Append(" EndTime: ").Append(EndTime).Append("\n"); + sb.Append(" Offer: ").Append(Offer).Append("\n"); + sb.Append(" Offerer: ").Append(Offerer).Append("\n"); + sb.Append(" OrderType: ").Append(OrderType).Append("\n"); + sb.Append(" Salt: ").Append(Salt).Append("\n"); + sb.Append(" StartTime: ").Append(StartTime).Append("\n"); + sb.Append(" TotalOriginalConsiderationItems: ").Append(TotalOriginalConsiderationItems).Append("\n"); + sb.Append(" Zone: ").Append(Zone).Append("\n"); + sb.Append(" ZoneHash: ").Append(ZoneHash).Append("\n"); + sb.Append(" Counter: ").Append(Counter).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/OrderComponents.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderComponents.cs.meta new file mode 100644 index 000000000..1ca6e968b --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponents.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc1fec08ec9c84db7888967c383c7873 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderComponentsConsiderationInner.cs b/src/Packages/Orderbook/Runtime/Model/OrderComponentsConsiderationInner.cs new file mode 100644 index 000000000..b8d0c7f16 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponentsConsiderationInner.cs @@ -0,0 +1,137 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// OrderComponentsConsiderationInner + /// + [DataContract(Name = "OrderComponents_consideration_inner")] + public class OrderComponentsConsiderationInner + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected OrderComponentsConsiderationInner() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// endAmount (required). + /// identifierOrCriteria (required). + /// itemType (required). + /// recipient (required). + /// startAmount (required). + /// token (required). + public OrderComponentsConsiderationInner(string endAmount = default, string identifierOrCriteria = default, + ItemType itemType = default, string recipient = default, string startAmount = default, + string token = default) + { + // to ensure "endAmount" is required (not null) + if (endAmount == null) + throw new ArgumentNullException( + "endAmount is a required property for OrderComponentsConsiderationInner and cannot be null"); + EndAmount = endAmount; + // to ensure "identifierOrCriteria" is required (not null) + if (identifierOrCriteria == null) + throw new ArgumentNullException( + "identifierOrCriteria is a required property for OrderComponentsConsiderationInner and cannot be null"); + IdentifierOrCriteria = identifierOrCriteria; + ItemType = itemType; + // to ensure "recipient" is required (not null) + if (recipient == null) + throw new ArgumentNullException( + "recipient is a required property for OrderComponentsConsiderationInner and cannot be null"); + Recipient = recipient; + // to ensure "startAmount" is required (not null) + if (startAmount == null) + throw new ArgumentNullException( + "startAmount is a required property for OrderComponentsConsiderationInner and cannot be null"); + StartAmount = startAmount; + // to ensure "token" is required (not null) + if (token == null) + throw new ArgumentNullException( + "token is a required property for OrderComponentsConsiderationInner and cannot be null"); + Token = token; + } + + /// + /// Gets or Sets ItemType + /// + [DataMember(Name = "itemType", IsRequired = true, EmitDefaultValue = true)] + public ItemType ItemType { get; set; } + + /// + /// Gets or Sets EndAmount + /// + [DataMember(Name = "endAmount", IsRequired = true, EmitDefaultValue = true)] + public string EndAmount { get; set; } + + /// + /// Gets or Sets IdentifierOrCriteria + /// + [DataMember(Name = "identifierOrCriteria", IsRequired = true, EmitDefaultValue = true)] + public string IdentifierOrCriteria { get; set; } + + /// + /// Gets or Sets Recipient + /// + [DataMember(Name = "recipient", IsRequired = true, EmitDefaultValue = true)] + public string Recipient { get; set; } + + /// + /// Gets or Sets StartAmount + /// + [DataMember(Name = "startAmount", IsRequired = true, EmitDefaultValue = true)] + public string StartAmount { get; set; } + + /// + /// Gets or Sets Token + /// + [DataMember(Name = "token", IsRequired = true, EmitDefaultValue = true)] + public string Token { 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 OrderComponentsConsiderationInner {\n"); + sb.Append(" EndAmount: ").Append(EndAmount).Append("\n"); + sb.Append(" IdentifierOrCriteria: ").Append(IdentifierOrCriteria).Append("\n"); + sb.Append(" ItemType: ").Append(ItemType).Append("\n"); + sb.Append(" Recipient: ").Append(Recipient).Append("\n"); + sb.Append(" StartAmount: ").Append(StartAmount).Append("\n"); + sb.Append(" Token: ").Append(Token).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/OrderComponentsConsiderationInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderComponentsConsiderationInner.cs.meta new file mode 100644 index 000000000..83115a9b7 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponentsConsiderationInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3e1f7543d9d0745768402e2c2c5319fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderComponentsOfferInner.cs b/src/Packages/Orderbook/Runtime/Model/OrderComponentsOfferInner.cs new file mode 100644 index 000000000..dfee85b2c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponentsOfferInner.cs @@ -0,0 +1,123 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// OrderComponentsOfferInner + /// + [DataContract(Name = "OrderComponents_offer_inner")] + public class OrderComponentsOfferInner + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected OrderComponentsOfferInner() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// endAmount (required). + /// identifierOrCriteria (required). + /// itemType (required). + /// startAmount (required). + /// token (required). + public OrderComponentsOfferInner(string endAmount = default, string identifierOrCriteria = default, + ItemType itemType = default, string startAmount = default, string token = default) + { + // to ensure "endAmount" is required (not null) + if (endAmount == null) + throw new ArgumentNullException( + "endAmount is a required property for OrderComponentsOfferInner and cannot be null"); + EndAmount = endAmount; + // to ensure "identifierOrCriteria" is required (not null) + if (identifierOrCriteria == null) + throw new ArgumentNullException( + "identifierOrCriteria is a required property for OrderComponentsOfferInner and cannot be null"); + IdentifierOrCriteria = identifierOrCriteria; + ItemType = itemType; + // to ensure "startAmount" is required (not null) + if (startAmount == null) + throw new ArgumentNullException( + "startAmount is a required property for OrderComponentsOfferInner and cannot be null"); + StartAmount = startAmount; + // to ensure "token" is required (not null) + if (token == null) + throw new ArgumentNullException( + "token is a required property for OrderComponentsOfferInner and cannot be null"); + Token = token; + } + + /// + /// Gets or Sets ItemType + /// + [DataMember(Name = "itemType", IsRequired = true, EmitDefaultValue = true)] + public ItemType ItemType { get; set; } + + /// + /// Gets or Sets EndAmount + /// + [DataMember(Name = "endAmount", IsRequired = true, EmitDefaultValue = true)] + public string EndAmount { get; set; } + + /// + /// Gets or Sets IdentifierOrCriteria + /// + [DataMember(Name = "identifierOrCriteria", IsRequired = true, EmitDefaultValue = true)] + public string IdentifierOrCriteria { get; set; } + + /// + /// Gets or Sets StartAmount + /// + [DataMember(Name = "startAmount", IsRequired = true, EmitDefaultValue = true)] + public string StartAmount { get; set; } + + /// + /// Gets or Sets Token + /// + [DataMember(Name = "token", IsRequired = true, EmitDefaultValue = true)] + public string Token { 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 OrderComponentsOfferInner {\n"); + sb.Append(" EndAmount: ").Append(EndAmount).Append("\n"); + sb.Append(" IdentifierOrCriteria: ").Append(IdentifierOrCriteria).Append("\n"); + sb.Append(" ItemType: ").Append(ItemType).Append("\n"); + sb.Append(" StartAmount: ").Append(StartAmount).Append("\n"); + sb.Append(" Token: ").Append(Token).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/OrderComponentsOfferInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderComponentsOfferInner.cs.meta new file mode 100644 index 000000000..11df21256 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderComponentsOfferInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7e1cfbcbe6ddd44538e4f9b60d9799b1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderFillStatus.cs b/src/Packages/Orderbook/Runtime/Model/OrderFillStatus.cs new file mode 100644 index 000000000..6495c6c7e --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderFillStatus.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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// OrderFillStatus + /// + [DataContract(Name = "Order_fillStatus")] + public class OrderFillStatus + { + /// + /// Initializes a new instance of the class. + /// + /// denominator. + /// numerator. + public OrderFillStatus(string denominator = default, string numerator = default) + { + Denominator = denominator; + Numerator = numerator; + } + + /// + /// Gets or Sets Denominator + /// + [DataMember(Name = "denominator", EmitDefaultValue = false)] + public string Denominator { get; set; } + + /// + /// Gets or Sets Numerator + /// + [DataMember(Name = "numerator", EmitDefaultValue = false)] + public string Numerator { 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 OrderFillStatus {\n"); + sb.Append(" Denominator: ").Append(Denominator).Append("\n"); + sb.Append(" Numerator: ").Append(Numerator).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/OrderFillStatus.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderFillStatus.cs.meta new file mode 100644 index 000000000..bb7b1884c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderFillStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e1e1b8fd2e30b4c568336a404b728b08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderProtocolData.cs b/src/Packages/Orderbook/Runtime/Model/OrderProtocolData.cs new file mode 100644 index 000000000..dfcfff5e4 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderProtocolData.cs @@ -0,0 +1,119 @@ +/* + * 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 +{ + /// + /// OrderProtocolData + /// + [DataContract(Name = "Order_protocolData")] + public class OrderProtocolData + { + /// + /// Defines OrderType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderTypeEnum + { + /// + /// Enum FULLRESTRICTED for value: FULL_RESTRICTED + /// + [EnumMember(Value = "FULL_RESTRICTED")] + FULLRESTRICTED, + + /// + /// Enum PARTIALRESTRICTED for value: PARTIAL_RESTRICTED + /// + [EnumMember(Value = "PARTIAL_RESTRICTED")] + PARTIALRESTRICTED + } + + /// + /// Initializes a new instance of the class. + /// + /// counter. + /// orderType. + /// seaportAddress. + /// seaportVersion. + /// zoneAddress. + public OrderProtocolData(string counter = default, OrderTypeEnum? orderType = default, + string seaportAddress = default, string seaportVersion = default, string zoneAddress = default) + { + Counter = counter; + OrderType = orderType; + SeaportAddress = seaportAddress; + SeaportVersion = seaportVersion; + ZoneAddress = zoneAddress; + } + + + /// + /// Gets or Sets OrderType + /// + [DataMember(Name = "orderType", EmitDefaultValue = false)] + public OrderTypeEnum? OrderType { get; set; } + + /// + /// Gets or Sets Counter + /// + [DataMember(Name = "counter", EmitDefaultValue = false)] + public string Counter { get; set; } + + /// + /// Gets or Sets SeaportAddress + /// + [DataMember(Name = "seaportAddress", EmitDefaultValue = false)] + public string SeaportAddress { get; set; } + + /// + /// Gets or Sets SeaportVersion + /// + [DataMember(Name = "seaportVersion", EmitDefaultValue = false)] + public string SeaportVersion { get; set; } + + /// + /// Gets or Sets ZoneAddress + /// + [DataMember(Name = "zoneAddress", EmitDefaultValue = false)] + public string ZoneAddress { 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 OrderProtocolData {\n"); + sb.Append(" Counter: ").Append(Counter).Append("\n"); + sb.Append(" OrderType: ").Append(OrderType).Append("\n"); + sb.Append(" SeaportAddress: ").Append(SeaportAddress).Append("\n"); + sb.Append(" SeaportVersion: ").Append(SeaportVersion).Append("\n"); + sb.Append(" ZoneAddress: ").Append(ZoneAddress).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/OrderProtocolData.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderProtocolData.cs.meta new file mode 100644 index 000000000..346655843 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderProtocolData.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9325a170bafc5461cb24735906210ed4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatus.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatus.cs new file mode 100644 index 000000000..a36555fc0 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatus.cs @@ -0,0 +1,406 @@ +/* + * 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 +{ + /// + /// The Order status + /// + [JsonConverter(typeof(OrderStatusJsonConverter))] + [DataContract(Name = "OrderStatus")] + public class OrderStatus : AbstractOpenAPISchema + { + private object _actualInstance; + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of OrderStatusOneOf. + public OrderStatus(OrderStatusOneOf 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 OrderStatusOneOf1. + public OrderStatus(OrderStatusOneOf1 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 OrderStatusOneOf2. + public OrderStatus(OrderStatusOneOf2 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 OrderStatusOneOf3. + public OrderStatus(OrderStatusOneOf3 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 OrderStatusOneOf4. + public OrderStatus(OrderStatusOneOf4 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 OrderStatusOneOf5. + public OrderStatus(OrderStatusOneOf5 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(OrderStatusOneOf) || value is OrderStatusOneOf) + _actualInstance = value; + else if (value.GetType() == typeof(OrderStatusOneOf1) || value is OrderStatusOneOf1) + _actualInstance = value; + else if (value.GetType() == typeof(OrderStatusOneOf2) || value is OrderStatusOneOf2) + _actualInstance = value; + else if (value.GetType() == typeof(OrderStatusOneOf3) || value is OrderStatusOneOf3) + _actualInstance = value; + else if (value.GetType() == typeof(OrderStatusOneOf4) || value is OrderStatusOneOf4) + _actualInstance = value; + else if (value.GetType() == typeof(OrderStatusOneOf5) || value is OrderStatusOneOf5) + _actualInstance = value; + else + throw new ArgumentException( + "Invalid instance found. Must be the following types: OrderStatusOneOf, OrderStatusOneOf1, OrderStatusOneOf2, OrderStatusOneOf3, OrderStatusOneOf4, OrderStatusOneOf5"); + } + } + + /// + /// Get the actual instance of `OrderStatusOneOf`. If the actual instance is not `OrderStatusOneOf`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf + public OrderStatusOneOf GetOrderStatusOneOf() + { + return (OrderStatusOneOf)ActualInstance; + } + + /// + /// Get the actual instance of `OrderStatusOneOf1`. If the actual instance is not `OrderStatusOneOf1`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf1 + public OrderStatusOneOf1 GetOrderStatusOneOf1() + { + return (OrderStatusOneOf1)ActualInstance; + } + + /// + /// Get the actual instance of `OrderStatusOneOf2`. If the actual instance is not `OrderStatusOneOf2`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf2 + public OrderStatusOneOf2 GetOrderStatusOneOf2() + { + return (OrderStatusOneOf2)ActualInstance; + } + + /// + /// Get the actual instance of `OrderStatusOneOf3`. If the actual instance is not `OrderStatusOneOf3`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf3 + public OrderStatusOneOf3 GetOrderStatusOneOf3() + { + return (OrderStatusOneOf3)ActualInstance; + } + + /// + /// Get the actual instance of `OrderStatusOneOf4`. If the actual instance is not `OrderStatusOneOf4`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf4 + public OrderStatusOneOf4 GetOrderStatusOneOf4() + { + return (OrderStatusOneOf4)ActualInstance; + } + + /// + /// Get the actual instance of `OrderStatusOneOf5`. If the actual instance is not `OrderStatusOneOf5`, + /// the InvalidClassException will be thrown + /// + /// An instance of OrderStatusOneOf5 + public OrderStatusOneOf5 GetOrderStatusOneOf5() + { + return (OrderStatusOneOf5)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class OrderStatus {\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 OrderStatus + /// + /// JSON string + /// An instance of OrderStatus + public static OrderStatus FromJson(string jsonString) + { + OrderStatus newOrderStatus = null; + + if (string.IsNullOrEmpty(jsonString)) return newOrderStatus; + var match = 0; + var matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf1).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf1"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf1: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf2).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf2"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf2: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf3).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf3"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf3: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf4).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf4"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf4: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(OrderStatusOneOf5).GetProperty("AdditionalProperties") == null) + newOrderStatus = + new OrderStatus( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newOrderStatus = + new OrderStatus(JsonConvert.DeserializeObject(jsonString, + AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("OrderStatusOneOf5"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into OrderStatusOneOf5: {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 newOrderStatus; + } + } + + /// + /// Custom JSON converter for OrderStatus + /// + public class OrderStatusJsonConverter : 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(OrderStatus).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 OrderStatus.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return OrderStatus.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/OrderStatus.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatus.cs.meta new file mode 100644 index 000000000..ba6a97f1e --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatus.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 311317b9b1119434db710cfcdd6dfe9d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf.cs new file mode 100644 index 000000000..1724da191 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf.cs @@ -0,0 +1,77 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf + /// + [DataContract(Name = "OrderStatus_oneOf")] + public class OrderStatusOneOf + { + /// + /// The order status that indicates an order can be fulfilled. + /// + /// The order status that indicates an order can be fulfilled. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum ACTIVE for value: ACTIVE + /// + [EnumMember(Value = "ACTIVE")] ACTIVE + } + + /// + /// Initializes a new instance of the class. + /// + /// The order status that indicates an order can be fulfilled.. + public OrderStatusOneOf(NameEnum? name = default) + { + Name = name; + } + + + /// + /// The order status that indicates an order can be fulfilled. + /// + /// The order status that indicates an order can be fulfilled. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { 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 OrderStatusOneOf {\n"); + sb.Append(" Name: ").Append(Name).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/OrderStatusOneOf.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf.cs.meta new file mode 100644 index 000000000..849e21805 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 26cca6f3551804fa58107a764686f7b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf1.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf1.cs new file mode 100644 index 000000000..83196c165 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf1.cs @@ -0,0 +1,97 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf1 + /// + [DataContract(Name = "OrderStatus_oneOf_1")] + public class OrderStatusOneOf1 + { + /// + /// The order status indicating a order is has been cancelled or about to be cancelled. + /// + /// The order status indicating a order is has been cancelled or about to be cancelled. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum CANCELLED for value: CANCELLED + /// + [EnumMember(Value = "CANCELLED")] CANCELLED + } + + /// + /// Initializes a new instance of the class. + /// + /// cancellationType. + /// The order status indicating a order is has been cancelled or about to be cancelled.. + /// Whether the cancellation of the order is pending. + public OrderStatusOneOf1(CancellationType? cancellationType = default, NameEnum? name = default, + bool pending = default) + { + CancellationType = cancellationType; + Name = name; + Pending = pending; + } + + /// + /// Gets or Sets CancellationType + /// + [DataMember(Name = "cancellation_type", EmitDefaultValue = false)] + public CancellationType? CancellationType { get; set; } + + + /// + /// The order status indicating a order is has been cancelled or about to be cancelled. + /// + /// The order status indicating a order is has been cancelled or about to be cancelled. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { get; set; } + + /// + /// Whether the cancellation of the order is pending + /// + /// Whether the cancellation of the order is pending + [DataMember(Name = "pending", EmitDefaultValue = true)] + public bool Pending { 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 OrderStatusOneOf1 {\n"); + sb.Append(" CancellationType: ").Append(CancellationType).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Pending: ").Append(Pending).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/OrderStatusOneOf1.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf1.cs.meta new file mode 100644 index 000000000..cb72d92a4 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf1.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 7612ac36b45d64b2e835ada48433185a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf2.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf2.cs new file mode 100644 index 000000000..372e42478 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf2.cs @@ -0,0 +1,77 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf2 + /// + [DataContract(Name = "OrderStatus_oneOf_2")] + public class OrderStatusOneOf2 + { + /// + /// A terminal order status indicating that an order cannot be fulfilled due to expiry. + /// + /// A terminal order status indicating that an order cannot be fulfilled due to expiry. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum EXPIRED for value: EXPIRED + /// + [EnumMember(Value = "EXPIRED")] EXPIRED + } + + /// + /// Initializes a new instance of the class. + /// + /// A terminal order status indicating that an order cannot be fulfilled due to expiry.. + public OrderStatusOneOf2(NameEnum? name = default) + { + Name = name; + } + + + /// + /// A terminal order status indicating that an order cannot be fulfilled due to expiry. + /// + /// A terminal order status indicating that an order cannot be fulfilled due to expiry. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { 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 OrderStatusOneOf2 {\n"); + sb.Append(" Name: ").Append(Name).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/OrderStatusOneOf2.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf2.cs.meta new file mode 100644 index 000000000..568489bad --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf2.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 54b845c83b88a4adc902583f7ded4157 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf3.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf3.cs new file mode 100644 index 000000000..1c2b22353 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf3.cs @@ -0,0 +1,77 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf3 + /// + [DataContract(Name = "OrderStatus_oneOf_3")] + public class OrderStatusOneOf3 + { + /// + /// A terminal order status indicating that an order has been fulfilled. + /// + /// A terminal order status indicating that an order has been fulfilled. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum FILLED for value: FILLED + /// + [EnumMember(Value = "FILLED")] FILLED + } + + /// + /// Initializes a new instance of the class. + /// + /// A terminal order status indicating that an order has been fulfilled.. + public OrderStatusOneOf3(NameEnum? name = default) + { + Name = name; + } + + + /// + /// A terminal order status indicating that an order has been fulfilled. + /// + /// A terminal order status indicating that an order has been fulfilled. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { 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 OrderStatusOneOf3 {\n"); + sb.Append(" Name: ").Append(Name).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/OrderStatusOneOf3.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf3.cs.meta new file mode 100644 index 000000000..4ed7819e8 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf3.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3610c34bcb5fc4eceac862017c2e4392 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf4.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf4.cs new file mode 100644 index 000000000..8a0a86f55 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf4.cs @@ -0,0 +1,98 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf4 + /// + [DataContract(Name = "OrderStatus_oneOf_4")] + public class OrderStatusOneOf4 + { + /// + /// The order status that indicates an order cannot be fulfilled. + /// + /// The order status that indicates an order cannot be fulfilled. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum INACTIVE for value: INACTIVE + /// + [EnumMember(Value = "INACTIVE")] INACTIVE + } + + /// + /// Initializes a new instance of the class. + /// + /// The order status that indicates an order cannot be fulfilled.. + /// Whether the order offerer has sufficient approvals. + /// Whether the order offerer still has sufficient balance to complete the order. + public OrderStatusOneOf4(NameEnum? name = default, bool sufficientApprovals = default, + bool sufficientBalances = default) + { + Name = name; + SufficientApprovals = sufficientApprovals; + SufficientBalances = sufficientBalances; + } + + + /// + /// The order status that indicates an order cannot be fulfilled. + /// + /// The order status that indicates an order cannot be fulfilled. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { get; set; } + + /// + /// Whether the order offerer has sufficient approvals + /// + /// Whether the order offerer has sufficient approvals + [DataMember(Name = "sufficient_approvals", EmitDefaultValue = true)] + public bool SufficientApprovals { get; set; } + + /// + /// Whether the order offerer still has sufficient balance to complete the order + /// + /// Whether the order offerer still has sufficient balance to complete the order + [DataMember(Name = "sufficient_balances", EmitDefaultValue = true)] + public bool SufficientBalances { 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 OrderStatusOneOf4 {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" SufficientApprovals: ").Append(SufficientApprovals).Append("\n"); + sb.Append(" SufficientBalances: ").Append(SufficientBalances).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/OrderStatusOneOf4.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf4.cs.meta new file mode 100644 index 000000000..a779c526b --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf4.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: eef841c7563cb4a6b818788dc1c689f9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf5.cs b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf5.cs new file mode 100644 index 000000000..3637bd29b --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf5.cs @@ -0,0 +1,97 @@ +/* + * 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 +{ + /// + /// OrderStatusOneOf5 + /// + [DataContract(Name = "OrderStatus_oneOf_5")] + public class OrderStatusOneOf5 + { + /// + /// The order status that indicates the order is yet to be active due to various reasons. + /// + /// The order status that indicates the order is yet to be active due to various reasons. + [JsonConverter(typeof(StringEnumConverter))] + public enum NameEnum + { + /// + /// Enum PENDING for value: PENDING + /// + [EnumMember(Value = "PENDING")] PENDING + } + + /// + /// Initializes a new instance of the class. + /// + /// Whether the order has been evaluated after its creation. + /// The order status that indicates the order is yet to be active due to various reasons.. + /// Whether the order has reached its specified start time. + public OrderStatusOneOf5(bool evaluated = default, NameEnum? name = default, bool started = default) + { + Evaluated = evaluated; + Name = name; + Started = started; + } + + + /// + /// The order status that indicates the order is yet to be active due to various reasons. + /// + /// The order status that indicates the order is yet to be active due to various reasons. + [DataMember(Name = "name", EmitDefaultValue = false)] + public NameEnum? Name { get; set; } + + /// + /// Whether the order has been evaluated after its creation + /// + /// Whether the order has been evaluated after its creation + [DataMember(Name = "evaluated", EmitDefaultValue = true)] + public bool Evaluated { get; set; } + + /// + /// Whether the order has reached its specified start time + /// + /// Whether the order has reached its specified start time + [DataMember(Name = "started", EmitDefaultValue = true)] + public bool Started { 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 OrderStatusOneOf5 {\n"); + sb.Append(" Evaluated: ").Append(Evaluated).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Started: ").Append(Started).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/OrderStatusOneOf5.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf5.cs.meta new file mode 100644 index 000000000..c8cbbfc5d --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderStatusOneOf5.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4591bf9b3989d4081bd3f55478233849 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/OrderType.cs b/src/Packages/Orderbook/Runtime/Model/OrderType.cs new file mode 100644 index 000000000..3f275880a --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderType.cs @@ -0,0 +1,44 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Defines OrderType + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OrderType + { + /// + /// Enum _0 for value: 0 + /// + [EnumMember(Value = "0")] _0, + + /// + /// Enum _1 for value: 1 + /// + [EnumMember(Value = "1")] _1, + + /// + /// Enum _2 for value: 2 + /// + [EnumMember(Value = "2")] _2, + + /// + /// Enum _3 for value: 3 + /// + [EnumMember(Value = "3")] _3 + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/OrderType.cs.meta b/src/Packages/Orderbook/Runtime/Model/OrderType.cs.meta new file mode 100644 index 000000000..d8e720948 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/OrderType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 092ff23810092462ba578e775a112fce +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareListing200Response.cs b/src/Packages/Orderbook/Runtime/Model/PrepareListing200Response.cs new file mode 100644 index 000000000..79859f6cd --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListing200Response.cs @@ -0,0 +1,102 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// Response schema for the prepareListing endpoint + /// + [DataContract(Name = "prepareListing_200_response")] + public class PrepareListing200Response + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PrepareListing200Response() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// actions (required). + /// orderComponents (required). + /// orderHash (required). + public PrepareListing200Response(List actions = default, OrderComponents orderComponents = default, + string orderHash = default) + { + // to ensure "actions" is required (not null) + if (actions == null) + throw new ArgumentNullException( + "actions is a required property for PrepareListing200Response and cannot be null"); + Actions = actions; + // to ensure "orderComponents" is required (not null) + if (orderComponents == null) + throw new ArgumentNullException( + "orderComponents is a required property for PrepareListing200Response and cannot be null"); + OrderComponents = orderComponents; + // to ensure "orderHash" is required (not null) + if (orderHash == null) + throw new ArgumentNullException( + "orderHash is a required property for PrepareListing200Response and cannot be null"); + OrderHash = orderHash; + } + + /// + /// Gets or Sets Actions + /// + [DataMember(Name = "actions", IsRequired = true, EmitDefaultValue = true)] + public List Actions { get; set; } + + /// + /// Gets or Sets OrderComponents + /// + [DataMember(Name = "orderComponents", IsRequired = true, EmitDefaultValue = true)] + public OrderComponents OrderComponents { get; set; } + + /// + /// Gets or Sets OrderHash + /// + [DataMember(Name = "orderHash", IsRequired = true, EmitDefaultValue = true)] + public string OrderHash { 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 PrepareListing200Response {\n"); + sb.Append(" Actions: ").Append(Actions).Append("\n"); + sb.Append(" OrderComponents: ").Append(OrderComponents).Append("\n"); + sb.Append(" OrderHash: ").Append(OrderHash).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/PrepareListing200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareListing200Response.cs.meta new file mode 100644 index 000000000..d8bdcb79c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListing200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c0a8c036f8ace440789008b622ec91d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareListingRequest.cs b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequest.cs new file mode 100644 index 000000000..bac8bf99c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequest.cs @@ -0,0 +1,110 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// PrepareListingRequest + /// + [DataContract(Name = "prepareListing_request")] + public class PrepareListingRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PrepareListingRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// buy (required). + /// makerAddress (required). + /// orderExpiry. + /// sell (required). + public PrepareListingRequest(PrepareListingRequestBuy buy = default, string makerAddress = default, + DateTime orderExpiry = default, PrepareListingRequestSell sell = default) + { + // to ensure "buy" is required (not null) + if (buy == null) + throw new ArgumentNullException( + "buy is a required property for PrepareListingRequest and cannot be null"); + Buy = buy; + // to ensure "makerAddress" is required (not null) + if (makerAddress == null) + throw new ArgumentNullException( + "makerAddress is a required property for PrepareListingRequest and cannot be null"); + MakerAddress = makerAddress; + // to ensure "sell" is required (not null) + if (sell == null) + throw new ArgumentNullException( + "sell is a required property for PrepareListingRequest and cannot be null"); + Sell = sell; + OrderExpiry = orderExpiry; + } + + /// + /// Gets or Sets Buy + /// + [DataMember(Name = "buy", IsRequired = true, EmitDefaultValue = true)] + public PrepareListingRequestBuy Buy { get; set; } + + /// + /// Gets or Sets MakerAddress + /// + [DataMember(Name = "makerAddress", IsRequired = true, EmitDefaultValue = true)] + public string MakerAddress { get; set; } + + /// + /// Gets or Sets OrderExpiry + /// + [DataMember(Name = "orderExpiry", EmitDefaultValue = false)] + public DateTime OrderExpiry { get; set; } + + /// + /// Gets or Sets Sell + /// + [DataMember(Name = "sell", IsRequired = true, EmitDefaultValue = true)] + public PrepareListingRequestSell Sell { 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 PrepareListingRequest {\n"); + sb.Append(" Buy: ").Append(Buy).Append("\n"); + sb.Append(" MakerAddress: ").Append(MakerAddress).Append("\n"); + sb.Append(" OrderExpiry: ").Append(OrderExpiry).Append("\n"); + sb.Append(" Sell: ").Append(Sell).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/PrepareListingRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequest.cs.meta new file mode 100644 index 000000000..d59ac91f5 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 1b38bbe057dc14ccb89584cf28a4ed93 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestBuy.cs b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestBuy.cs new file mode 100644 index 000000000..c322c4bc9 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestBuy.cs @@ -0,0 +1,228 @@ +/* + * 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 +{ + /// + /// PrepareListingRequestBuy + /// + [JsonConverter(typeof(PrepareListingRequestBuyJsonConverter))] + [DataContract(Name = "prepareListing_request_buy")] + public class PrepareListingRequestBuy : AbstractOpenAPISchema + { + private object _actualInstance; + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ERC20Item. + public PrepareListingRequestBuy(ERC20Item 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 NativeItem. + public PrepareListingRequestBuy(NativeItem 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(ERC20Item) || value is ERC20Item) + _actualInstance = value; + else if (value.GetType() == typeof(NativeItem) || value is NativeItem) + _actualInstance = value; + else + throw new ArgumentException( + "Invalid instance found. Must be the following types: ERC20Item, NativeItem"); + } + } + + /// + /// Get the actual instance of `ERC20Item`. If the actual instance is not `ERC20Item`, + /// the InvalidClassException will be thrown + /// + /// An instance of ERC20Item + public ERC20Item GetERC20Item() + { + return (ERC20Item)ActualInstance; + } + + /// + /// Get the actual instance of `NativeItem`. If the actual instance is not `NativeItem`, + /// the InvalidClassException will be thrown + /// + /// An instance of NativeItem + public NativeItem GetNativeItem() + { + return (NativeItem)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PrepareListingRequestBuy {\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 PrepareListingRequestBuy + /// + /// JSON string + /// An instance of PrepareListingRequestBuy + public static PrepareListingRequestBuy FromJson(string jsonString) + { + PrepareListingRequestBuy newPrepareListingRequestBuy = null; + + if (string.IsNullOrEmpty(jsonString)) return newPrepareListingRequestBuy; + var match = 0; + var matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ERC20Item).GetProperty("AdditionalProperties") == null) + newPrepareListingRequestBuy = + new PrepareListingRequestBuy( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newPrepareListingRequestBuy = new PrepareListingRequestBuy( + JsonConvert.DeserializeObject(jsonString, AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("ERC20Item"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into ERC20Item: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(NativeItem).GetProperty("AdditionalProperties") == null) + newPrepareListingRequestBuy = + new PrepareListingRequestBuy( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newPrepareListingRequestBuy = new PrepareListingRequestBuy( + JsonConvert.DeserializeObject(jsonString, AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("NativeItem"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into NativeItem: {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 newPrepareListingRequestBuy; + } + } + + /// + /// Custom JSON converter for PrepareListingRequestBuy + /// + public class PrepareListingRequestBuyJsonConverter : 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(PrepareListingRequestBuy).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 PrepareListingRequestBuy.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return PrepareListingRequestBuy.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/PrepareListingRequestBuy.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestBuy.cs.meta new file mode 100644 index 000000000..c7bc56335 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestBuy.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 6dbb4931d79c04afd8453e1502c8335c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestSell.cs b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestSell.cs new file mode 100644 index 000000000..6008ac90a --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestSell.cs @@ -0,0 +1,228 @@ +/* + * 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 +{ + /// + /// PrepareListingRequestSell + /// + [JsonConverter(typeof(PrepareListingRequestSellJsonConverter))] + [DataContract(Name = "prepareListing_request_sell")] + public class PrepareListingRequestSell : AbstractOpenAPISchema + { + private object _actualInstance; + + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of ERC1155Item. + public PrepareListingRequestSell(ERC1155Item 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 ERC721Item. + public PrepareListingRequestSell(ERC721Item 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(ERC1155Item) || value is ERC1155Item) + _actualInstance = value; + else if (value.GetType() == typeof(ERC721Item) || value is ERC721Item) + _actualInstance = value; + else + throw new ArgumentException( + "Invalid instance found. Must be the following types: ERC1155Item, ERC721Item"); + } + } + + /// + /// Get the actual instance of `ERC1155Item`. If the actual instance is not `ERC1155Item`, + /// the InvalidClassException will be thrown + /// + /// An instance of ERC1155Item + public ERC1155Item GetERC1155Item() + { + return (ERC1155Item)ActualInstance; + } + + /// + /// Get the actual instance of `ERC721Item`. If the actual instance is not `ERC721Item`, + /// the InvalidClassException will be thrown + /// + /// An instance of ERC721Item + public ERC721Item GetERC721Item() + { + return (ERC721Item)ActualInstance; + } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class PrepareListingRequestSell {\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 PrepareListingRequestSell + /// + /// JSON string + /// An instance of PrepareListingRequestSell + public static PrepareListingRequestSell FromJson(string jsonString) + { + PrepareListingRequestSell newPrepareListingRequestSell = null; + + if (string.IsNullOrEmpty(jsonString)) return newPrepareListingRequestSell; + var match = 0; + var matchedTypes = new List(); + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ERC1155Item).GetProperty("AdditionalProperties") == null) + newPrepareListingRequestSell = + new PrepareListingRequestSell( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newPrepareListingRequestSell = new PrepareListingRequestSell( + JsonConvert.DeserializeObject(jsonString, AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("ERC1155Item"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into ERC1155Item: {1}", jsonString, exception); + } + + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(ERC721Item).GetProperty("AdditionalProperties") == null) + newPrepareListingRequestSell = + new PrepareListingRequestSell( + JsonConvert.DeserializeObject(jsonString, SerializerSettings)); + else + newPrepareListingRequestSell = new PrepareListingRequestSell( + JsonConvert.DeserializeObject(jsonString, AdditionalPropertiesSerializerSettings)); + matchedTypes.Add("ERC721Item"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + Debug.WriteLine("Failed to deserialize `{0}` into ERC721Item: {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 newPrepareListingRequestSell; + } + } + + /// + /// Custom JSON converter for PrepareListingRequestSell + /// + public class PrepareListingRequestSellJsonConverter : 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(PrepareListingRequestSell).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 PrepareListingRequestSell.FromJson(JObject.Load(reader).ToString(Formatting.None)); + case JsonToken.StartArray: + return PrepareListingRequestSell.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/PrepareListingRequestSell.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestSell.cs.meta new file mode 100644 index 000000000..7facec9d4 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareListingRequestSell.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 13e07b0c120f349509b01950a2c78e04 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellations200Response.cs b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellations200Response.cs new file mode 100644 index 000000000..2e10aa338 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellations200Response.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 prepareOrderCancellations endpoint + /// + [DataContract(Name = "prepareOrderCancellations_200_response")] + public class PrepareOrderCancellations200Response + { + /// + /// Initializes a new instance of the class. + /// + /// signableAction. + public PrepareOrderCancellations200Response(SignableAction signableAction = default) + { + SignableAction = signableAction; + } + + /// + /// Gets or Sets SignableAction + /// + [DataMember(Name = "signableAction", EmitDefaultValue = false)] + public SignableAction SignableAction { 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 PrepareOrderCancellations200Response {\n"); + sb.Append(" SignableAction: ").Append(SignableAction).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/PrepareOrderCancellations200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellations200Response.cs.meta new file mode 100644 index 000000000..d740807e1 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellations200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f33e9b9008fc34f4f800d15576381232 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellationsRequest.cs b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellationsRequest.cs new file mode 100644 index 000000000..7158cb611 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellationsRequest.cs @@ -0,0 +1,75 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// PrepareOrderCancellationsRequest + /// + [DataContract(Name = "prepareOrderCancellations_request")] + public class PrepareOrderCancellationsRequest + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected PrepareOrderCancellationsRequest() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// orderIds (required). + public PrepareOrderCancellationsRequest(List orderIds = default) + { + // to ensure "orderIds" is required (not null) + if (orderIds == null) + throw new ArgumentNullException( + "orderIds is a required property for PrepareOrderCancellationsRequest and cannot be null"); + OrderIds = orderIds; + } + + /// + /// Gets or Sets OrderIds + /// + [DataMember(Name = "orderIds", IsRequired = true, EmitDefaultValue = true)] + public List OrderIds { 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 PrepareOrderCancellationsRequest {\n"); + sb.Append(" OrderIds: ").Append(OrderIds).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/PrepareOrderCancellationsRequest.cs.meta b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellationsRequest.cs.meta new file mode 100644 index 000000000..ee6b1f3f1 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/PrepareOrderCancellationsRequest.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 427bbaaf9ae174bf48f31b679d2c2560 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/RecordStringTypedDataFieldValueInner.cs b/src/Packages/Orderbook/Runtime/Model/RecordStringTypedDataFieldValueInner.cs new file mode 100644 index 000000000..18ec546bd --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/RecordStringTypedDataFieldValueInner.cs @@ -0,0 +1,87 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// RecordStringTypedDataFieldValueInner + /// + [DataContract(Name = "RecordStringTypedDataField_value_inner")] + public class RecordStringTypedDataFieldValueInner + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected RecordStringTypedDataFieldValueInner() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// name (required). + /// type (required). + public RecordStringTypedDataFieldValueInner(string name = default, string type = default) + { + // to ensure "name" is required (not null) + if (name == null) + throw new ArgumentNullException( + "name is a required property for RecordStringTypedDataFieldValueInner and cannot be null"); + Name = name; + // to ensure "type" is required (not null) + if (type == null) + throw new ArgumentNullException( + "type is a required property for RecordStringTypedDataFieldValueInner and cannot be null"); + Type = type; + } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)] + public string Name { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public string Type { 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 RecordStringTypedDataFieldValueInner {\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Type: ").Append(Type).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/RecordStringTypedDataFieldValueInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/RecordStringTypedDataFieldValueInner.cs.meta new file mode 100644 index 000000000..5f70996c0 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/RecordStringTypedDataFieldValueInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 58798a358022d46b9835689aef6788dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/SignableAction.cs b/src/Packages/Orderbook/Runtime/Model/SignableAction.cs new file mode 100644 index 000000000..ea44c0fa7 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignableAction.cs @@ -0,0 +1,102 @@ +/* + * 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 +{ + /// + /// SignableAction + /// + [DataContract(Name = "SignableAction")] + public class SignableAction + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum SIGNABLE for value: SIGNABLE + /// + [EnumMember(Value = "SIGNABLE")] SIGNABLE + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected SignableAction() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// message. + /// purpose. + /// type (required). + public SignableAction(SignableActionMessage message = default, SignablePurpose? purpose = default, + TypeEnum type = default) + { + Type = type; + Message = message; + Purpose = purpose; + } + + /// + /// Gets or Sets Purpose + /// + [DataMember(Name = "purpose", EmitDefaultValue = false)] + public SignablePurpose? Purpose { get; set; } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public SignableActionMessage Message { 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 SignableAction {\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" Purpose: ").Append(Purpose).Append("\n"); + sb.Append(" Type: ").Append(Type).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/SignableAction.cs.meta b/src/Packages/Orderbook/Runtime/Model/SignableAction.cs.meta new file mode 100644 index 000000000..55918c666 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignableAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4549bade5a88b47568d4c20d7a138b1d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/SignableActionMessage.cs b/src/Packages/Orderbook/Runtime/Model/SignableActionMessage.cs new file mode 100644 index 000000000..2c22921fe --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignableActionMessage.cs @@ -0,0 +1,91 @@ +/* + * 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 +{ + /// + /// SignableActionMessage + /// + [DataContract(Name = "SignableAction_message")] + public class SignableActionMessage + { + /// + /// Initializes a new instance of the class. + /// + /// domain. + /// types. + /// message. + /// primaryType. + public SignableActionMessage(TypedDataDomain domain = default, + Dictionary> types = default, + Dictionary message = default, string primaryType = default) + { + Domain = domain; + Types = types; + Message = message; + PrimaryType = primaryType; + } + + /// + /// Gets or Sets Domain + /// + [DataMember(Name = "domain", EmitDefaultValue = false)] + public TypedDataDomain Domain { get; set; } + + /// + /// Gets or Sets Types + /// + [DataMember(Name = "types", EmitDefaultValue = false)] + public Dictionary> Types { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name = "message", EmitDefaultValue = false)] + public Dictionary Message { get; set; } + + /// + /// Gets or Sets PrimaryType + /// + [DataMember(Name = "primaryType", EmitDefaultValue = false)] + public string PrimaryType { 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 SignableActionMessage {\n"); + sb.Append(" Domain: ").Append(Domain).Append("\n"); + sb.Append(" Types: ").Append(Types).Append("\n"); + sb.Append(" Message: ").Append(Message).Append("\n"); + sb.Append(" PrimaryType: ").Append(PrimaryType).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/SignableActionMessage.cs.meta b/src/Packages/Orderbook/Runtime/Model/SignableActionMessage.cs.meta new file mode 100644 index 000000000..a7d080b4c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignableActionMessage.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5dc59e06892d47edb6572dbe74fe8c9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/SignablePurpose.cs b/src/Packages/Orderbook/Runtime/Model/SignablePurpose.cs new file mode 100644 index 000000000..81aeafff8 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignablePurpose.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.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Defines SignablePurpose + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SignablePurpose + { + /// + /// Enum CREATELISTING for value: CREATE_LISTING + /// + [EnumMember(Value = "CREATE_LISTING")] CREATELISTING, + + /// + /// Enum OFFCHAINCANCELLATION for value: OFF_CHAIN_CANCELLATION + /// + [EnumMember(Value = "OFF_CHAIN_CANCELLATION")] + OFFCHAINCANCELLATION + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/SignablePurpose.cs.meta b/src/Packages/Orderbook/Runtime/Model/SignablePurpose.cs.meta new file mode 100644 index 000000000..13531ac74 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/SignablePurpose.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2383cd64cedc440ca12bd022b8c96da +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TokenBalance200Response.cs b/src/Packages/Orderbook/Runtime/Model/TokenBalance200Response.cs new file mode 100644 index 000000000..c9a4dc165 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TokenBalance200Response.cs @@ -0,0 +1,74 @@ +/* + * 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.Runtime.Serialization; +using System.Text; +using Newtonsoft.Json; + +namespace Immutable.Orderbook.Model +{ + /// + /// The response body returned from get balance endpoint + /// + [DataContract(Name = "tokenBalance_200_response")] + public class TokenBalance200Response + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TokenBalance200Response() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// quantity (required). + public TokenBalance200Response(string quantity = default) + { + // to ensure "quantity" is required (not null) + if (quantity == null) + throw new ArgumentNullException( + "quantity is a required property for TokenBalance200Response and cannot be null"); + Quantity = quantity; + } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name = "quantity", IsRequired = true, EmitDefaultValue = true)] + public string Quantity { 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 TokenBalance200Response {\n"); + sb.Append(" Quantity: ").Append(Quantity).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/TokenBalance200Response.cs.meta b/src/Packages/Orderbook/Runtime/Model/TokenBalance200Response.cs.meta new file mode 100644 index 000000000..c8fe9ace1 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TokenBalance200Response.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d486538e37c3a454390c7392c5f73b56 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TransactionAction.cs b/src/Packages/Orderbook/Runtime/Model/TransactionAction.cs new file mode 100644 index 000000000..71a567e5f --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionAction.cs @@ -0,0 +1,102 @@ +/* + * 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 +{ + /// + /// TransactionAction + /// + [DataContract(Name = "TransactionAction")] + public class TransactionAction + { + /// + /// Defines Type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TypeEnum + { + /// + /// Enum TRANSACTION for value: TRANSACTION + /// + [EnumMember(Value = "TRANSACTION")] TRANSACTION + } + + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected TransactionAction() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// populatedTransactions. + /// purpose. + /// type (required). + public TransactionAction(TransactionActionPopulatedTransactions populatedTransactions = default, + TransactionPurpose? purpose = default, TypeEnum type = default) + { + Type = type; + PopulatedTransactions = populatedTransactions; + Purpose = purpose; + } + + /// + /// Gets or Sets Purpose + /// + [DataMember(Name = "purpose", EmitDefaultValue = false)] + public TransactionPurpose? Purpose { get; set; } + + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)] + public TypeEnum Type { get; set; } + + /// + /// Gets or Sets PopulatedTransactions + /// + [DataMember(Name = "populatedTransactions", EmitDefaultValue = false)] + public TransactionActionPopulatedTransactions PopulatedTransactions { 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 TransactionAction {\n"); + sb.Append(" PopulatedTransactions: ").Append(PopulatedTransactions).Append("\n"); + sb.Append(" Purpose: ").Append(Purpose).Append("\n"); + sb.Append(" Type: ").Append(Type).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/TransactionAction.cs.meta b/src/Packages/Orderbook/Runtime/Model/TransactionAction.cs.meta new file mode 100644 index 000000000..f73bc5309 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionAction.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c184ea88a0f5d41c4a9ff1027980e30d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactions.cs b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactions.cs new file mode 100644 index 000000000..9301b8ac4 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactions.cs @@ -0,0 +1,184 @@ +/* + * 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 +{ + /// + /// TransactionActionPopulatedTransactions + /// + [DataContract(Name = "TransactionAction_populatedTransactions")] + public class TransactionActionPopulatedTransactions + { + /// + /// Initializes a new instance of the class. + /// + /// to. + /// from. + /// nonce. + /// gasLimit. + /// gasPrice. + /// data. + /// value. + /// chainId. + /// type. + /// accessList. + /// maxFeePerGas. + /// maxPriorityFeePerGas. + /// customData. + /// ccipReadEnabled. + public TransactionActionPopulatedTransactions(string to = default, string from = default, + decimal nonce = default, string gasLimit = default, string gasPrice = default, string data = default, + string value = default, decimal chainId = default, decimal type = default, + List accessList = default, + string maxFeePerGas = default, string maxPriorityFeePerGas = default, + Dictionary customData = default, bool ccipReadEnabled = default) + { + To = to; + From = from; + Nonce = nonce; + GasLimit = gasLimit; + GasPrice = gasPrice; + Data = data; + Value = value; + ChainId = chainId; + Type = type; + AccessList = accessList; + MaxFeePerGas = maxFeePerGas; + MaxPriorityFeePerGas = maxPriorityFeePerGas; + CustomData = customData; + CcipReadEnabled = ccipReadEnabled; + } + + /// + /// Gets or Sets To + /// + [DataMember(Name = "to", EmitDefaultValue = false)] + public string To { get; set; } + + /// + /// Gets or Sets From + /// + [DataMember(Name = "from", EmitDefaultValue = false)] + public string From { get; set; } + + /// + /// Gets or Sets Nonce + /// + [DataMember(Name = "nonce", EmitDefaultValue = false)] + public decimal Nonce { get; set; } + + /// + /// Gets or Sets GasLimit + /// + [DataMember(Name = "gasLimit", EmitDefaultValue = false)] + public string GasLimit { get; set; } + + /// + /// Gets or Sets GasPrice + /// + [DataMember(Name = "gasPrice", EmitDefaultValue = false)] + public string GasPrice { get; set; } + + /// + /// Gets or Sets Data + /// + [DataMember(Name = "data", EmitDefaultValue = false)] + public string Data { get; set; } + + /// + /// Gets or Sets Value + /// + [DataMember(Name = "value", EmitDefaultValue = false)] + public string Value { get; set; } + + /// + /// Gets or Sets ChainId + /// + [DataMember(Name = "chainId", EmitDefaultValue = false)] + public decimal ChainId { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name = "type", EmitDefaultValue = false)] + public decimal Type { get; set; } + + /// + /// Gets or Sets AccessList + /// + [DataMember(Name = "accessList", EmitDefaultValue = false)] + public List AccessList { get; set; } + + /// + /// Gets or Sets MaxFeePerGas + /// + [DataMember(Name = "maxFeePerGas", EmitDefaultValue = false)] + public string MaxFeePerGas { get; set; } + + /// + /// Gets or Sets MaxPriorityFeePerGas + /// + [DataMember(Name = "maxPriorityFeePerGas", EmitDefaultValue = false)] + public string MaxPriorityFeePerGas { get; set; } + + /// + /// Gets or Sets CustomData + /// + [DataMember(Name = "customData", EmitDefaultValue = false)] + public Dictionary CustomData { get; set; } + + /// + /// Gets or Sets CcipReadEnabled + /// + [DataMember(Name = "ccipReadEnabled", EmitDefaultValue = true)] + public bool CcipReadEnabled { 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 TransactionActionPopulatedTransactions {\n"); + sb.Append(" To: ").Append(To).Append("\n"); + sb.Append(" From: ").Append(From).Append("\n"); + sb.Append(" Nonce: ").Append(Nonce).Append("\n"); + sb.Append(" GasLimit: ").Append(GasLimit).Append("\n"); + sb.Append(" GasPrice: ").Append(GasPrice).Append("\n"); + sb.Append(" Data: ").Append(Data).Append("\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" ChainId: ").Append(ChainId).Append("\n"); + sb.Append(" Type: ").Append(Type).Append("\n"); + sb.Append(" AccessList: ").Append(AccessList).Append("\n"); + sb.Append(" MaxFeePerGas: ").Append(MaxFeePerGas).Append("\n"); + sb.Append(" MaxPriorityFeePerGas: ").Append(MaxPriorityFeePerGas).Append("\n"); + sb.Append(" CustomData: ").Append(CustomData).Append("\n"); + sb.Append(" CcipReadEnabled: ").Append(CcipReadEnabled).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/TransactionActionPopulatedTransactions.cs.meta b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactions.cs.meta new file mode 100644 index 000000000..d9dfb6cae --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48ab54472e4114952aa2fef86a56121e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactionsAccessListInner.cs b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactionsAccessListInner.cs new file mode 100644 index 000000000..26d411afe --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactionsAccessListInner.cs @@ -0,0 +1,72 @@ +/* + * 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 +{ + /// + /// TransactionActionPopulatedTransactionsAccessListInner + /// + [DataContract(Name = "TransactionAction_populatedTransactions_accessList_inner")] + public class TransactionActionPopulatedTransactionsAccessListInner + { + /// + /// Initializes a new instance of the class. + /// + /// address. + /// storageKeys. + public TransactionActionPopulatedTransactionsAccessListInner(string address = default, + List storageKeys = default) + { + Address = address; + StorageKeys = storageKeys; + } + + /// + /// Gets or Sets Address + /// + [DataMember(Name = "address", EmitDefaultValue = false)] + public string Address { get; set; } + + /// + /// Gets or Sets StorageKeys + /// + [DataMember(Name = "storageKeys", EmitDefaultValue = false)] + public List StorageKeys { 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 TransactionActionPopulatedTransactionsAccessListInner {\n"); + sb.Append(" Address: ").Append(Address).Append("\n"); + sb.Append(" StorageKeys: ").Append(StorageKeys).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/TransactionActionPopulatedTransactionsAccessListInner.cs.meta b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactionsAccessListInner.cs.meta new file mode 100644 index 000000000..3ddcc0adc --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionActionPopulatedTransactionsAccessListInner.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 465bf936a3cfd4d72aaf4e1a1c96a9f7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs b/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs new file mode 100644 index 000000000..5fb7272de --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs @@ -0,0 +1,39 @@ +/* + * 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 Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Immutable.Orderbook.Model +{ + /// + /// Defines TransactionPurpose + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TransactionPurpose + { + /// + /// Enum APPROVAL for value: APPROVAL + /// + [EnumMember(Value = "APPROVAL")] APPROVAL, + + /// + /// Enum FULFILLORDER for value: FULFILL_ORDER + /// + [EnumMember(Value = "FULFILL_ORDER")] FULFILLORDER, + + /// + /// Enum CANCEL for value: CANCEL + /// + [EnumMember(Value = "CANCEL")] CANCEL + } +} \ No newline at end of file diff --git a/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs.meta b/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs.meta new file mode 100644 index 000000000..bb981d1e0 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TransactionPurpose.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 370ab0586be3e49d49275191ebd13491 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/Runtime/Model/TypedDataDomain.cs b/src/Packages/Orderbook/Runtime/Model/TypedDataDomain.cs new file mode 100644 index 000000000..e0a04a753 --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TypedDataDomain.cs @@ -0,0 +1,98 @@ +/* + * 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 +{ + /// + /// TypedDataDomain + /// + [DataContract(Name = "TypedDataDomain")] + public class TypedDataDomain + { + /// + /// Initializes a new instance of the class. + /// + /// chainId. + /// name. + /// salt. + /// verifyingContract. + /// varVersion. + public TypedDataDomain(string chainId = default, string name = default, string salt = default, + string verifyingContract = default, string varVersion = default) + { + ChainId = chainId; + Name = name; + Salt = salt; + VerifyingContract = verifyingContract; + VarVersion = varVersion; + } + + /// + /// Gets or Sets ChainId + /// + [DataMember(Name = "chainId", EmitDefaultValue = false)] + public string ChainId { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name = "name", EmitDefaultValue = false)] + public string Name { get; set; } + + /// + /// Gets or Sets Salt + /// + [DataMember(Name = "salt", EmitDefaultValue = false)] + public string Salt { get; set; } + + /// + /// Gets or Sets VerifyingContract + /// + [DataMember(Name = "verifyingContract", EmitDefaultValue = false)] + public string VerifyingContract { get; set; } + + /// + /// Gets or Sets VarVersion + /// + [DataMember(Name = "version", EmitDefaultValue = false)] + public string VarVersion { 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 TypedDataDomain {\n"); + sb.Append(" ChainId: ").Append(ChainId).Append("\n"); + sb.Append(" Name: ").Append(Name).Append("\n"); + sb.Append(" Salt: ").Append(Salt).Append("\n"); + sb.Append(" VerifyingContract: ").Append(VerifyingContract).Append("\n"); + sb.Append(" VarVersion: ").Append(VarVersion).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/TypedDataDomain.cs.meta b/src/Packages/Orderbook/Runtime/Model/TypedDataDomain.cs.meta new file mode 100644 index 000000000..ff1560a2c --- /dev/null +++ b/src/Packages/Orderbook/Runtime/Model/TypedDataDomain.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c4df55c001be14c9c8a834c666a27927 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/Packages/Orderbook/package.json b/src/Packages/Orderbook/package.json new file mode 100644 index 000000000..b4b11a2b6 --- /dev/null +++ b/src/Packages/Orderbook/package.json @@ -0,0 +1,19 @@ +{ + "name": "com.immutable.orderbook", + "version": "0.1.0-alpha", + "description": "Orderbook package for the Immutable SDK for Unity", + "displayName": "Immutable Orderbook", + "author": { + "name": "Immutable", + "url": "https://immutable.com" + }, + "dependencies": { + "com.cysharp.unitask": "2.3.3" + }, + "keywords": [ + "unity", + "immutable", + "Orderbook" + ], + "unity": "2021.3" +} \ No newline at end of file diff --git a/src/Packages/Orderbook/package.json.meta b/src/Packages/Orderbook/package.json.meta new file mode 100644 index 000000000..8b4b6fe2b --- /dev/null +++ b/src/Packages/Orderbook/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4a4f5fed79b484dd19b5d58d6d6fc129 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: