diff --git a/.gitignore b/.gitignore index 3a83c2f..0f74d29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,19 @@ -# See https://www.dartlang.org/guides/libraries/private-files +# See https://dart.dev/guides/libraries/private-files -# Files and directories created by pub .dart_tool/ .packages build/ -# If you're building an application, you may want to check-in your pubspec.lock + +# Except for application packages pubspec.lock -# Directory created by dartdoc -# If you don't generate documentation locally you can remove this line. doc/api/ -# dotenv environment variables file -.env* - -# Avoid committing generated Javascript files: -*.dart.js -*.info.json # Produced by the --dump-info flag. -*.js # When generated by dart2js. Don't specify *.js if your - # project includes source files written in JavaScript. -*.js_ -*.js.deps -*.js.map +# IntelliJ +*.iml +*.ipr +*.iws +.idea/ -.flutter-plugins -.flutter-plugins-dependencies +# Mac +.DS_Store diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..94d3ade --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,202 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +analysis_options.yaml +doc/Address.md +doc/ApiError.md +doc/ApiErrorResponse.md +doc/ApiErrorSource.md +doc/Blockchain.md +doc/Coin.md +doc/CoinsApi.md +doc/ConfirmSellOrderData.md +doc/ConfirmSellOrderRequest.md +doc/ConfirmSellOrderResponse.md +doc/CountriesApi.md +doc/Country.md +doc/CreateKycAccountData.md +doc/CreateKycAccountRequest.md +doc/CreateKycAccountResponse.md +doc/CreateNftOrderData.md +doc/CreateNftOrderRequest.md +doc/CreateNftOrderResponse.md +doc/CreateOrderData.md +doc/CreateOrderRequest.md +doc/CreateOrderResponse.md +doc/CreateQuoteData.md +doc/CreateQuoteRequest.md +doc/CreateQuoteResponse.md +doc/Fiat.md +doc/FiatsApi.md +doc/GetCoinsData.md +doc/GetCoinsResponse.md +doc/GetCountriesData.md +doc/GetCountriesResponse.md +doc/GetFiatsData.md +doc/GetFiatsResponse.md +doc/GetKycAccountData.md +doc/GetKycAccountResponse.md +doc/GetOrderData.md +doc/GetOrderResponse.md +doc/GetOrdersData.md +doc/GetOrdersResponse.md +doc/GetPaymentMethodsData.md +doc/GetPaymentMethodsResponse.md +doc/GetPricesData.md +doc/GetPricesResponse.md +doc/GetQuoteData.md +doc/GetQuoteResponse.md +doc/KYCApi.md +doc/KycAccount.md +doc/KycDocumentImage.md +doc/KycShare.md +doc/NftCheckoutData.md +doc/NftOrdersApi.md +doc/Order.md +doc/OrderDepositAddress.md +doc/OrdersApi.md +doc/Pagination.md +doc/PaymentMethod.md +doc/PaymentMethodsApi.md +doc/Price.md +doc/PricesApi.md +doc/Quote.md +doc/QuotesApi.md +doc/SellOrdersApi.md +doc/TransactionFee.md +git_push.sh +lib/api.dart +lib/api/coins_api.dart +lib/api/countries_api.dart +lib/api/fiats_api.dart +lib/api/kyc_api.dart +lib/api/nft_orders_api.dart +lib/api/orders_api.dart +lib/api/payment_methods_api.dart +lib/api/prices_api.dart +lib/api/quotes_api.dart +lib/api/sell_orders_api.dart +lib/api_client.dart +lib/api_exception.dart +lib/api_helper.dart +lib/auth/api_key_auth.dart +lib/auth/authentication.dart +lib/auth/http_basic_auth.dart +lib/auth/http_bearer_auth.dart +lib/auth/oauth.dart +lib/model/address.dart +lib/model/api_error.dart +lib/model/api_error_response.dart +lib/model/api_error_source.dart +lib/model/blockchain.dart +lib/model/coin.dart +lib/model/confirm_sell_order_data.dart +lib/model/confirm_sell_order_request.dart +lib/model/confirm_sell_order_response.dart +lib/model/country.dart +lib/model/create_kyc_account_data.dart +lib/model/create_kyc_account_request.dart +lib/model/create_kyc_account_response.dart +lib/model/create_nft_order_data.dart +lib/model/create_nft_order_request.dart +lib/model/create_nft_order_response.dart +lib/model/create_order_data.dart +lib/model/create_order_request.dart +lib/model/create_order_response.dart +lib/model/create_quote_data.dart +lib/model/create_quote_request.dart +lib/model/create_quote_response.dart +lib/model/fiat.dart +lib/model/get_coins_data.dart +lib/model/get_coins_response.dart +lib/model/get_countries_data.dart +lib/model/get_countries_response.dart +lib/model/get_fiats_data.dart +lib/model/get_fiats_response.dart +lib/model/get_kyc_account_data.dart +lib/model/get_kyc_account_response.dart +lib/model/get_order_data.dart +lib/model/get_order_response.dart +lib/model/get_orders_data.dart +lib/model/get_orders_response.dart +lib/model/get_payment_methods_data.dart +lib/model/get_payment_methods_response.dart +lib/model/get_prices_data.dart +lib/model/get_prices_response.dart +lib/model/get_quote_data.dart +lib/model/get_quote_response.dart +lib/model/kyc_account.dart +lib/model/kyc_document_image.dart +lib/model/kyc_share.dart +lib/model/nft_checkout_data.dart +lib/model/order.dart +lib/model/order_deposit_address.dart +lib/model/pagination.dart +lib/model/payment_method.dart +lib/model/price.dart +lib/model/quote.dart +lib/model/transaction_fee.dart +pubspec.yaml +test/address_test.dart +test/api_error_response_test.dart +test/api_error_source_test.dart +test/api_error_test.dart +test/blockchain_test.dart +test/coin_test.dart +test/coins_api_test.dart +test/confirm_sell_order_data_test.dart +test/confirm_sell_order_request_test.dart +test/confirm_sell_order_response_test.dart +test/countries_api_test.dart +test/country_test.dart +test/create_kyc_account_data_test.dart +test/create_kyc_account_request_test.dart +test/create_kyc_account_response_test.dart +test/create_nft_order_data_test.dart +test/create_nft_order_request_test.dart +test/create_nft_order_response_test.dart +test/create_order_data_test.dart +test/create_order_request_test.dart +test/create_order_response_test.dart +test/create_quote_data_test.dart +test/create_quote_request_test.dart +test/create_quote_response_test.dart +test/fiat_test.dart +test/fiats_api_test.dart +test/get_coins_data_test.dart +test/get_coins_response_test.dart +test/get_countries_data_test.dart +test/get_countries_response_test.dart +test/get_fiats_data_test.dart +test/get_fiats_response_test.dart +test/get_kyc_account_data_test.dart +test/get_kyc_account_response_test.dart +test/get_order_data_test.dart +test/get_order_response_test.dart +test/get_orders_data_test.dart +test/get_orders_response_test.dart +test/get_payment_methods_data_test.dart +test/get_payment_methods_response_test.dart +test/get_prices_data_test.dart +test/get_prices_response_test.dart +test/get_quote_data_test.dart +test/get_quote_response_test.dart +test/kyc_account_test.dart +test/kyc_api_test.dart +test/kyc_document_image_test.dart +test/kyc_share_test.dart +test/nft_checkout_data_test.dart +test/nft_orders_api_test.dart +test/order_deposit_address_test.dart +test/order_test.dart +test/orders_api_test.dart +test/pagination_test.dart +test/payment_method_test.dart +test/payment_methods_api_test.dart +test/price_test.dart +test/prices_api_test.dart +test/quote_test.dart +test/quotes_api_test.dart +test/sell_orders_api_test.dart +test/transaction_fee_test.dart diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 0000000..368fd8f --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.15.0 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..2774ccb --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.12" +install: +- pub get + +script: +- pub run test diff --git a/README.md b/README.md new file mode 100644 index 0000000..b60bf51 --- /dev/null +++ b/README.md @@ -0,0 +1,163 @@ +# openapi +API for Banxa services, enabling crypto purchases, KYC processes, and more. +This specification is reverse-engineered from the Banxa PHP SDK and official API documentation, with server URL adjusted based on user-provided examples. +Authentication is performed via HMAC-SHA256 signatures using API Key, API Secret, Timestamp, and Nonce. +- X-BANXA-KEY: Your API Key. +- X-BANXA-SIGNATURE: The HMAC-SHA256 signature. +- X-BANXA-TIMESTAMP: Current UNIX timestamp. +- X-BANXA-NONCE: A unique, randomly generated string for each request. + +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: v2 +- Generator version: 7.15.0 +- Build package: org.openapitools.codegen.languages.DartClientCodegen +For more information, please visit [https://support.banxa.com/](https://support.banxa.com/) + +## Requirements + +Dart 2.12 or later + +## Installation & Usage + +### Github +If this Dart package is published to Github, add the following dependency to your pubspec.yaml +``` +dependencies: + openapi: + git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` + +### Local +To use the package in your local drive, add the following dependency to your pubspec.yaml +``` +dependencies: + openapi: + path: /path/to/openapi +``` + +## Tests + +TODO + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```dart +import 'package:openapi/api.dart'; + +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = CoinsApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. + +try { + final result = api_instance.getCoins(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage); + print(result); +} catch (e) { + print('Exception when calling CoinsApi->getCoins: $e\n'); +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*CoinsApi* | [**getCoins**](doc//CoinsApi.md#getcoins) | **GET** /coins | Retrieve a list of Crypto Currencies +*CountriesApi* | [**getCountries**](doc//CountriesApi.md#getcountries) | **GET** /countries | Retrieve a list of Countries +*FiatsApi* | [**getFiats**](doc//FiatsApi.md#getfiats) | **GET** /fiats/{orderType} | Retrieve a list of Fiat Currencies +*KYCApi* | [**createKycAccount**](doc//KYCApi.md#createkycaccount) | **POST** /kyc/accounts | Create or Update KYC Account +*KYCApi* | [**getKycAccount**](doc//KYCApi.md#getkycaccount) | **GET** /kyc/accounts/{account_reference} | Retrieve KYC Account Details +*NftOrdersApi* | [**createNftOrder**](doc//NftOrdersApi.md#createnftorder) | **POST** /nft/orders | Create an NFT Order +*OrdersApi* | [**createOrder**](doc//OrdersApi.md#createorder) | **POST** /orders | Create an Order +*OrdersApi* | [**getOrder**](doc//OrdersApi.md#getorder) | **GET** /orders/{order_id} | Retrieve an Order +*OrdersApi* | [**getOrders**](doc//OrdersApi.md#getorders) | **GET** /orders | Retrieve a list of Orders +*PaymentMethodsApi* | [**getPaymentMethods**](doc//PaymentMethodsApi.md#getpaymentmethods) | **GET** /payment-methods | Retrieve a list of Payment Methods +*PricesApi* | [**getPrices**](doc//PricesApi.md#getprices) | **GET** /prices | Retrieve Prices +*QuotesApi* | [**createQuote**](doc//QuotesApi.md#createquote) | **POST** /quotes | Create a Quote +*QuotesApi* | [**getQuote**](doc//QuotesApi.md#getquote) | **GET** /quotes/{id} | Retrieve a Quote +*SellOrdersApi* | [**confirmSellOrder**](doc//SellOrdersApi.md#confirmsellorder) | **POST** /orders/{order_id}/sell/confirm | Confirm a Sell Order + + +## Documentation For Models + + - [Address](doc//Address.md) + - [ApiError](doc//ApiError.md) + - [ApiErrorResponse](doc//ApiErrorResponse.md) + - [ApiErrorSource](doc//ApiErrorSource.md) + - [Blockchain](doc//Blockchain.md) + - [Coin](doc//Coin.md) + - [ConfirmSellOrderData](doc//ConfirmSellOrderData.md) + - [ConfirmSellOrderRequest](doc//ConfirmSellOrderRequest.md) + - [ConfirmSellOrderResponse](doc//ConfirmSellOrderResponse.md) + - [Country](doc//Country.md) + - [CreateKycAccountData](doc//CreateKycAccountData.md) + - [CreateKycAccountRequest](doc//CreateKycAccountRequest.md) + - [CreateKycAccountResponse](doc//CreateKycAccountResponse.md) + - [CreateNftOrderData](doc//CreateNftOrderData.md) + - [CreateNftOrderRequest](doc//CreateNftOrderRequest.md) + - [CreateNftOrderResponse](doc//CreateNftOrderResponse.md) + - [CreateOrderData](doc//CreateOrderData.md) + - [CreateOrderRequest](doc//CreateOrderRequest.md) + - [CreateOrderResponse](doc//CreateOrderResponse.md) + - [CreateQuoteData](doc//CreateQuoteData.md) + - [CreateQuoteRequest](doc//CreateQuoteRequest.md) + - [CreateQuoteResponse](doc//CreateQuoteResponse.md) + - [Fiat](doc//Fiat.md) + - [GetCoinsData](doc//GetCoinsData.md) + - [GetCoinsResponse](doc//GetCoinsResponse.md) + - [GetCountriesData](doc//GetCountriesData.md) + - [GetCountriesResponse](doc//GetCountriesResponse.md) + - [GetFiatsData](doc//GetFiatsData.md) + - [GetFiatsResponse](doc//GetFiatsResponse.md) + - [GetKycAccountData](doc//GetKycAccountData.md) + - [GetKycAccountResponse](doc//GetKycAccountResponse.md) + - [GetOrderData](doc//GetOrderData.md) + - [GetOrderResponse](doc//GetOrderResponse.md) + - [GetOrdersData](doc//GetOrdersData.md) + - [GetOrdersResponse](doc//GetOrdersResponse.md) + - [GetPaymentMethodsData](doc//GetPaymentMethodsData.md) + - [GetPaymentMethodsResponse](doc//GetPaymentMethodsResponse.md) + - [GetPricesData](doc//GetPricesData.md) + - [GetPricesResponse](doc//GetPricesResponse.md) + - [GetQuoteData](doc//GetQuoteData.md) + - [GetQuoteResponse](doc//GetQuoteResponse.md) + - [KycAccount](doc//KycAccount.md) + - [KycDocumentImage](doc//KycDocumentImage.md) + - [KycShare](doc//KycShare.md) + - [NftCheckoutData](doc//NftCheckoutData.md) + - [Order](doc//Order.md) + - [OrderDepositAddress](doc//OrderDepositAddress.md) + - [Pagination](doc//Pagination.md) + - [PaymentMethod](doc//PaymentMethod.md) + - [Price](doc//Price.md) + - [Quote](doc//Quote.md) + - [TransactionFee](doc//TransactionFee.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### BanxaAuth + +- **Type**: API key +- **API key parameter name**: X-BANXA-KEY +- **Location**: HTTP header + + +## Author + + + diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..e69de29 diff --git a/doc/Address.md b/doc/Address.md new file mode 100644 index 0000000..f45c0c6 --- /dev/null +++ b/doc/Address.md @@ -0,0 +1,20 @@ +# openapi.model.Address + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**street1** | **String** | | +**street2** | **String** | | [optional] +**suburbCity** | **String** | | +**stateProvince** | **String** | | [optional] +**postCodeZip** | **String** | | +**countryCode** | **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/doc/ApiError.md b/doc/ApiError.md new file mode 100644 index 0000000..0117ed8 --- /dev/null +++ b/doc/ApiError.md @@ -0,0 +1,19 @@ +# openapi.model.ApiError + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | The HTTP status code applicable to this problem, expressed as a string value. | [optional] +**title** | **String** | A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. | [optional] +**detail** | **String** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**code** | **String** | A Banxa-specific error code. | [optional] +**source_** | [**ApiErrorSource**](ApiErrorSource.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/doc/ApiErrorResponse.md b/doc/ApiErrorResponse.md new file mode 100644 index 0000000..fdb2431 --- /dev/null +++ b/doc/ApiErrorResponse.md @@ -0,0 +1,15 @@ +# openapi.model.ApiErrorResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**List**](ApiError.md) | | [default to const []] + +[[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/doc/ApiErrorSource.md b/doc/ApiErrorSource.md new file mode 100644 index 0000000..f92553b --- /dev/null +++ b/doc/ApiErrorSource.md @@ -0,0 +1,16 @@ +# openapi.model.ApiErrorSource + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pointer** | **String** | A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. \"/data\" for a primary data object, or \"/data/attributes/title\" for a specific attribute]. | [optional] +**parameter** | **String** | A string indicating which URI query parameter caused the error. | [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/doc/Blockchain.md b/doc/Blockchain.md new file mode 100644 index 0000000..86e5969 --- /dev/null +++ b/doc/Blockchain.md @@ -0,0 +1,21 @@ +# openapi.model.Blockchain + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | | [optional] +**description** | **String** | | [optional] +**isDefault** | **bool** | | [optional] +**withdrawalFee** | **String** | | [optional] +**depositFee** | **String** | | [optional] +**minWithdrawal** | **String** | | [optional] +**type** | **String** | Type of blockchain (e.g. MAINNET) | [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/doc/Coin.md b/doc/Coin.md new file mode 100644 index 0000000..0863ffe --- /dev/null +++ b/doc/Coin.md @@ -0,0 +1,18 @@ +# openapi.model.Coin + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coinCode** | **String** | The unique code for the coin. | [optional] +**coinName** | **String** | The name of the coin. | [optional] +**status** | **String** | Status of the coin. | [optional] +**blockchains** | [**List**](Blockchain.md) | | [optional] [default to const []] + +[[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/doc/CoinsApi.md b/doc/CoinsApi.md new file mode 100644 index 0000000..bcfe324 --- /dev/null +++ b/doc/CoinsApi.md @@ -0,0 +1,69 @@ +# openapi.api.CoinsApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getCoins**](CoinsApi.md#getcoins) | **GET** /coins | Retrieve a list of Crypto Currencies + + +# **getCoins** +> GetCoinsResponse getCoins(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage) + +Retrieve a list of Crypto Currencies + +Fetches a paginated list of all supported crypto currencies and their blockchain details. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = CoinsApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. + +try { + final result = api_instance.getCoins(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage); + print(result); +} catch (e) { + print('Exception when calling CoinsApi->getCoins: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **page** | **int**| Page number for pagination. | [optional] [default to 1] + **perPage** | **int**| Number of items per page. | [optional] [default to 25] + +### Return type + +[**GetCoinsResponse**](GetCoinsResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/ConfirmSellOrderData.md b/doc/ConfirmSellOrderData.md new file mode 100644 index 0000000..2424a5b --- /dev/null +++ b/doc/ConfirmSellOrderData.md @@ -0,0 +1,15 @@ +# openapi.model.ConfirmSellOrderData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/doc/ConfirmSellOrderRequest.md b/doc/ConfirmSellOrderRequest.md new file mode 100644 index 0000000..60fcd80 --- /dev/null +++ b/doc/ConfirmSellOrderRequest.md @@ -0,0 +1,18 @@ +# openapi.model.ConfirmSellOrderRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transactionHash** | **String** | The transaction hash (ID) of the crypto deposit made by the user. | +**source_** | **String** | Source of the transaction information (e.g., BLOCKCHAIN_EXPLORER, USER_INPUT). | +**sourceAddress** | **String** | The user's wallet address from which the crypto was sent. | +**sourceAddressTag** | **String** | Tag or memo for the source wallet address, if applicable. | [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/doc/ConfirmSellOrderResponse.md b/doc/ConfirmSellOrderResponse.md new file mode 100644 index 0000000..19f3e69 --- /dev/null +++ b/doc/ConfirmSellOrderResponse.md @@ -0,0 +1,15 @@ +# openapi.model.ConfirmSellOrderResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ConfirmSellOrderData**](ConfirmSellOrderData.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/doc/CountriesApi.md b/doc/CountriesApi.md new file mode 100644 index 0000000..73c864e --- /dev/null +++ b/doc/CountriesApi.md @@ -0,0 +1,69 @@ +# openapi.api.CountriesApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getCountries**](CountriesApi.md#getcountries) | **GET** /countries | Retrieve a list of Countries + + +# **getCountries** +> GetCountriesResponse getCountries(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage) + +Retrieve a list of Countries + +Fetches a paginated list of supported countries. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = CountriesApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. + +try { + final result = api_instance.getCountries(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage); + print(result); +} catch (e) { + print('Exception when calling CountriesApi->getCountries: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **page** | **int**| Page number for pagination. | [optional] [default to 1] + **perPage** | **int**| Number of items per page. | [optional] [default to 25] + +### Return type + +[**GetCountriesResponse**](GetCountriesResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/Country.md b/doc/Country.md new file mode 100644 index 0000000..78ba032 --- /dev/null +++ b/doc/Country.md @@ -0,0 +1,19 @@ +# openapi.model.Country + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**countryCode** | **String** | ISO 3166-1 alpha-2 country code. | [optional] +**countryName** | **String** | Name of the country. | [optional] +**status** | **String** | Status. | [optional] +**isStateRequired** | **bool** | | [optional] +**supportedDocuments** | **List** | | [optional] [default to const []] + +[[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/doc/CreateKycAccountData.md b/doc/CreateKycAccountData.md new file mode 100644 index 0000000..f2ad710 --- /dev/null +++ b/doc/CreateKycAccountData.md @@ -0,0 +1,15 @@ +# openapi.model.CreateKycAccountData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kycAccount** | [**KycAccount**](KycAccount.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/doc/CreateKycAccountRequest.md b/doc/CreateKycAccountRequest.md new file mode 100644 index 0000000..176f384 --- /dev/null +++ b/doc/CreateKycAccountRequest.md @@ -0,0 +1,27 @@ +# openapi.model.CreateKycAccountRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountReference** | **String** | | +**givenName** | **String** | | +**middleName** | **String** | | [optional] +**surname** | **String** | | +**dob** | [**DateTime**](DateTime.md) | | +**email** | **String** | | +**mobileNumber** | **String** | | +**residentialAddress** | [**Address**](Address.md) | | +**documentType** | **String** | | +**documentIdNumber** | **String** | | [optional] +**documentCountryOfIssue** | **String** | | +**documentImages** | [**List**](KycDocumentImage.md) | | [optional] [default to const []] +**metaData** | [**Map**](Object.md) | Arbitrary key-value pairs for additional metadata. | [optional] [default to const {}] + +[[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/doc/CreateKycAccountResponse.md b/doc/CreateKycAccountResponse.md new file mode 100644 index 0000000..edb24a7 --- /dev/null +++ b/doc/CreateKycAccountResponse.md @@ -0,0 +1,15 @@ +# openapi.model.CreateKycAccountResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CreateKycAccountData**](CreateKycAccountData.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/doc/CreateNftOrderData.md b/doc/CreateNftOrderData.md new file mode 100644 index 0000000..2ee271d --- /dev/null +++ b/doc/CreateNftOrderData.md @@ -0,0 +1,15 @@ +# openapi.model.CreateNftOrderData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/doc/CreateNftOrderRequest.md b/doc/CreateNftOrderRequest.md new file mode 100644 index 0000000..178923f --- /dev/null +++ b/doc/CreateNftOrderRequest.md @@ -0,0 +1,24 @@ +# openapi.model.CreateNftOrderRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountReference** | **String** | | +**targetWalletAddress** | **String** | | +**targetBlockchain** | **String** | | +**paymentMethodId** | **int** | | +**nfts** | [**List**](NftCheckoutData.md) | | [default to const []] +**returnUrlOnSuccess** | **String** | | +**returnUrlOnFailure** | **String** | | +**returnUrlOnPending** | **String** | | [optional] +**iframeReferralDomain** | **String** | | [optional] +**metaData** | [**Map**](Object.md) | Arbitrary key-value pairs for additional metadata. | [optional] [default to const {}] + +[[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/doc/CreateNftOrderResponse.md b/doc/CreateNftOrderResponse.md new file mode 100644 index 0000000..b0d73bc --- /dev/null +++ b/doc/CreateNftOrderResponse.md @@ -0,0 +1,15 @@ +# openapi.model.CreateNftOrderResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CreateNftOrderData**](CreateNftOrderData.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/doc/CreateOrderData.md b/doc/CreateOrderData.md new file mode 100644 index 0000000..440374a --- /dev/null +++ b/doc/CreateOrderData.md @@ -0,0 +1,15 @@ +# openapi.model.CreateOrderData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/doc/CreateOrderRequest.md b/doc/CreateOrderRequest.md new file mode 100644 index 0000000..12ff6cf --- /dev/null +++ b/doc/CreateOrderRequest.md @@ -0,0 +1,28 @@ +# openapi.model.CreateOrderRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountReference** | **String** | Your internal reference for the user/account. | +**fiatCurrency** | **String** | Fiat currency code for the order. For BUY, this is source. For SELL, this is target. | +**coinCurrency** | **String** | Coin currency code for the order. For BUY, this is target. For SELL, this is source. | +**coinAmount** | **String** | Amount of coin to buy/sell. Provide either this or fiat_amount. | [optional] +**fiatAmount** | **String** | Amount of fiat to spend/receive. Provide either this or coin_amount. | [optional] +**paymentMethodId** | **int** | ID of the chosen payment method. | +**walletAddress** | **String** | User's crypto wallet address (for BUY orders). | [optional] +**walletAddressTag** | **String** | Tag or memo for certain wallet addresses (e.g., XRP, XLM). | [optional] +**returnUrlOnSuccess** | **String** | URL to redirect the user to on successful payment/order. | +**returnUrlOnFailure** | **String** | URL to redirect the user to on failed payment/order. | +**returnUrlOnPending** | **String** | URL to redirect the user to if payment is pending. | [optional] +**iframeReferralDomain** | **String** | If using Banxa checkout in an iframe, your domain. | [optional] +**blockchain** | **String** | Specify blockchain for the coin if applicable. | [optional] +**quoteId** | **String** | Optional ID of a previously created quote to use for this 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/doc/CreateOrderResponse.md b/doc/CreateOrderResponse.md new file mode 100644 index 0000000..32379b1 --- /dev/null +++ b/doc/CreateOrderResponse.md @@ -0,0 +1,15 @@ +# openapi.model.CreateOrderResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CreateOrderData**](CreateOrderData.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/doc/CreateQuoteData.md b/doc/CreateQuoteData.md new file mode 100644 index 0000000..22a7e63 --- /dev/null +++ b/doc/CreateQuoteData.md @@ -0,0 +1,15 @@ +# openapi.model.CreateQuoteData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote** | [**Quote**](Quote.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/doc/CreateQuoteRequest.md b/doc/CreateQuoteRequest.md new file mode 100644 index 0000000..23c37a6 --- /dev/null +++ b/doc/CreateQuoteRequest.md @@ -0,0 +1,21 @@ +# openapi.model.CreateQuoteRequest + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceCurrency** | **String** | The currency code to convert from (e.g., USD, BTC). | +**targetCurrency** | **String** | The currency code to convert to (e.g., BTC, USD). | +**sourceAmount** | **String** | Amount of source currency. Either source_amount or target_amount is required. | [optional] +**targetAmount** | **String** | Amount of target currency. Either source_amount or target_amount is required. | [optional] +**accountReference** | **String** | Your internal reference for the user/account. | +**paymentMethodId** | **int** | Optional payment method ID to get a quote specific to it. | [optional] +**blockchain** | **String** | Specify blockchain for the target crypto if applicable. | [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/doc/CreateQuoteResponse.md b/doc/CreateQuoteResponse.md new file mode 100644 index 0000000..2dfbba1 --- /dev/null +++ b/doc/CreateQuoteResponse.md @@ -0,0 +1,15 @@ +# openapi.model.CreateQuoteResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**CreateQuoteData**](CreateQuoteData.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/doc/Fiat.md b/doc/Fiat.md new file mode 100644 index 0000000..be5020d --- /dev/null +++ b/doc/Fiat.md @@ -0,0 +1,18 @@ +# openapi.model.Fiat + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fiatCode** | **String** | The unique code for the fiat currency. | [optional] +**fiatName** | **String** | The name of the fiat currency. | [optional] +**fiatSymbol** | **String** | The symbol for the fiat currency. | [optional] +**status** | **String** | Status of the fiat currency. | [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/doc/FiatsApi.md b/doc/FiatsApi.md new file mode 100644 index 0000000..1ab2e3a --- /dev/null +++ b/doc/FiatsApi.md @@ -0,0 +1,71 @@ +# openapi.api.FiatsApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getFiats**](FiatsApi.md#getfiats) | **GET** /fiats/{orderType} | Retrieve a list of Fiat Currencies + + +# **getFiats** +> GetFiatsResponse getFiats(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderType, page, perPage) + +Retrieve a list of Fiat Currencies + +Fetches a paginated list of all supported fiat currencies, filterable by order type (BUY or SELL). + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = FiatsApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final orderType = orderType_example; // String | Filter fiats by their availability for 'BUY' or 'SELL' operations. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. + +try { + final result = api_instance.getFiats(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderType, page, perPage); + print(result); +} catch (e) { + print('Exception when calling FiatsApi->getFiats: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **orderType** | **String**| Filter fiats by their availability for 'BUY' or 'SELL' operations. | + **page** | **int**| Page number for pagination. | [optional] [default to 1] + **perPage** | **int**| Number of items per page. | [optional] [default to 25] + +### Return type + +[**GetFiatsResponse**](GetFiatsResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/GetCoinsData.md b/doc/GetCoinsData.md new file mode 100644 index 0000000..df001f8 --- /dev/null +++ b/doc/GetCoinsData.md @@ -0,0 +1,15 @@ +# openapi.model.GetCoinsData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**coins** | [**List**](Coin.md) | | [optional] [default to const []] + +[[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/doc/GetCoinsResponse.md b/doc/GetCoinsResponse.md new file mode 100644 index 0000000..712f3c7 --- /dev/null +++ b/doc/GetCoinsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.GetCoinsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**data** | [**GetCoinsData**](GetCoinsData.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/doc/GetCountriesData.md b/doc/GetCountriesData.md new file mode 100644 index 0000000..5ef9b29 --- /dev/null +++ b/doc/GetCountriesData.md @@ -0,0 +1,15 @@ +# openapi.model.GetCountriesData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**countries** | [**List**](Country.md) | | [optional] [default to const []] + +[[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/doc/GetCountriesResponse.md b/doc/GetCountriesResponse.md new file mode 100644 index 0000000..a18749c --- /dev/null +++ b/doc/GetCountriesResponse.md @@ -0,0 +1,16 @@ +# openapi.model.GetCountriesResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**data** | [**GetCountriesData**](GetCountriesData.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/doc/GetFiatsData.md b/doc/GetFiatsData.md new file mode 100644 index 0000000..b5e9692 --- /dev/null +++ b/doc/GetFiatsData.md @@ -0,0 +1,15 @@ +# openapi.model.GetFiatsData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fiats** | [**List**](Fiat.md) | | [optional] [default to const []] + +[[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/doc/GetFiatsResponse.md b/doc/GetFiatsResponse.md new file mode 100644 index 0000000..bf8c528 --- /dev/null +++ b/doc/GetFiatsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.GetFiatsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**data** | [**GetFiatsData**](GetFiatsData.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/doc/GetKycAccountData.md b/doc/GetKycAccountData.md new file mode 100644 index 0000000..2db6405 --- /dev/null +++ b/doc/GetKycAccountData.md @@ -0,0 +1,15 @@ +# openapi.model.GetKycAccountData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kycAccount** | [**KycAccount**](KycAccount.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/doc/GetKycAccountResponse.md b/doc/GetKycAccountResponse.md new file mode 100644 index 0000000..fd0061d --- /dev/null +++ b/doc/GetKycAccountResponse.md @@ -0,0 +1,15 @@ +# openapi.model.GetKycAccountResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**GetKycAccountData**](GetKycAccountData.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/doc/GetOrderData.md b/doc/GetOrderData.md new file mode 100644 index 0000000..29328fb --- /dev/null +++ b/doc/GetOrderData.md @@ -0,0 +1,15 @@ +# openapi.model.GetOrderData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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/doc/GetOrderResponse.md b/doc/GetOrderResponse.md new file mode 100644 index 0000000..eaa8723 --- /dev/null +++ b/doc/GetOrderResponse.md @@ -0,0 +1,15 @@ +# openapi.model.GetOrderResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**GetOrderData**](GetOrderData.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/doc/GetOrdersData.md b/doc/GetOrdersData.md new file mode 100644 index 0000000..4523fb8 --- /dev/null +++ b/doc/GetOrdersData.md @@ -0,0 +1,15 @@ +# openapi.model.GetOrdersData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**orders** | [**List**](Order.md) | | [optional] [default to const []] + +[[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/doc/GetOrdersResponse.md b/doc/GetOrdersResponse.md new file mode 100644 index 0000000..1a6900f --- /dev/null +++ b/doc/GetOrdersResponse.md @@ -0,0 +1,16 @@ +# openapi.model.GetOrdersResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**data** | [**GetOrdersData**](GetOrdersData.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/doc/GetPaymentMethodsData.md b/doc/GetPaymentMethodsData.md new file mode 100644 index 0000000..f3d0128 --- /dev/null +++ b/doc/GetPaymentMethodsData.md @@ -0,0 +1,15 @@ +# openapi.model.GetPaymentMethodsData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paymentMethods** | [**List**](PaymentMethod.md) | | [optional] [default to const []] + +[[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/doc/GetPaymentMethodsResponse.md b/doc/GetPaymentMethodsResponse.md new file mode 100644 index 0000000..05a2cd6 --- /dev/null +++ b/doc/GetPaymentMethodsResponse.md @@ -0,0 +1,16 @@ +# openapi.model.GetPaymentMethodsResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**data** | [**GetPaymentMethodsData**](GetPaymentMethodsData.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/doc/GetPricesData.md b/doc/GetPricesData.md new file mode 100644 index 0000000..678c99f --- /dev/null +++ b/doc/GetPricesData.md @@ -0,0 +1,15 @@ +# openapi.model.GetPricesData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prices** | [**List**](Price.md) | | [optional] [default to const []] + +[[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/doc/GetPricesResponse.md b/doc/GetPricesResponse.md new file mode 100644 index 0000000..c127f4d --- /dev/null +++ b/doc/GetPricesResponse.md @@ -0,0 +1,15 @@ +# openapi.model.GetPricesResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**GetPricesData**](GetPricesData.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/doc/GetQuoteData.md b/doc/GetQuoteData.md new file mode 100644 index 0000000..6ad4466 --- /dev/null +++ b/doc/GetQuoteData.md @@ -0,0 +1,15 @@ +# openapi.model.GetQuoteData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote** | [**Quote**](Quote.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/doc/GetQuoteResponse.md b/doc/GetQuoteResponse.md new file mode 100644 index 0000000..30ccfb6 --- /dev/null +++ b/doc/GetQuoteResponse.md @@ -0,0 +1,15 @@ +# openapi.model.GetQuoteResponse + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**GetQuoteData**](GetQuoteData.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/doc/KYCApi.md b/doc/KYCApi.md new file mode 100644 index 0000000..090e7a1 --- /dev/null +++ b/doc/KYCApi.md @@ -0,0 +1,121 @@ +# openapi.api.KYCApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createKycAccount**](KYCApi.md#createkycaccount) | **POST** /kyc/accounts | Create or Update KYC Account +[**getKycAccount**](KYCApi.md#getkycaccount) | **GET** /kyc/accounts/{account_reference} | Retrieve KYC Account Details + + +# **createKycAccount** +> CreateKycAccountResponse createKycAccount(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createKycAccountRequest) + +Create or Update KYC Account + +Submits customer KYC information to Banxa for verification. This can create a new KYC application or update an existing one. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = KYCApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final createKycAccountRequest = CreateKycAccountRequest(); // CreateKycAccountRequest | KYC submission details. + +try { + final result = api_instance.createKycAccount(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createKycAccountRequest); + print(result); +} catch (e) { + print('Exception when calling KYCApi->createKycAccount: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **createKycAccountRequest** | [**CreateKycAccountRequest**](CreateKycAccountRequest.md)| KYC submission details. | + +### Return type + +[**CreateKycAccountResponse**](CreateKycAccountResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + +# **getKycAccount** +> GetKycAccountResponse getKycAccount(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, accountReference) + +Retrieve KYC Account Details + +Fetches KYC status and details for a given account reference. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = KYCApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final accountReference = accountReference_example; // String | Your internal reference for the user/account used during KYC submission. + +try { + final result = api_instance.getKycAccount(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, accountReference); + print(result); +} catch (e) { + print('Exception when calling KYCApi->getKycAccount: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **accountReference** | **String**| Your internal reference for the user/account used during KYC submission. | + +### Return type + +[**GetKycAccountResponse**](GetKycAccountResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/KycAccount.md b/doc/KycAccount.md new file mode 100644 index 0000000..9732be6 --- /dev/null +++ b/doc/KycAccount.md @@ -0,0 +1,21 @@ +# openapi.model.KycAccount + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountReference** | **String** | | [optional] +**kycApplicationId** | **String** | | [optional] +**kycStatus** | **String** | Overall KYC status for the account. | [optional] +**kycUrl** | **String** | URL to redirect the user to for KYC process if action is required. | [optional] +**kycShares** | [**List**](KycShare.md) | | [optional] [default to const []] +**createdAt** | [**DateTime**](DateTime.md) | | [optional] +**updatedAt** | [**DateTime**](DateTime.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/doc/KycDocumentImage.md b/doc/KycDocumentImage.md new file mode 100644 index 0000000..1a309ac --- /dev/null +++ b/doc/KycDocumentImage.md @@ -0,0 +1,17 @@ +# openapi.model.KycDocumentImage + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**url** | **String** | URL of the uploaded document image (e.g., pre-signed S3 URL). | +**contentType** | **String** | MIME type of the image. | +**fileName** | **String** | Original file name of the image. | [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/doc/KycShare.md b/doc/KycShare.md new file mode 100644 index 0000000..287bfd2 --- /dev/null +++ b/doc/KycShare.md @@ -0,0 +1,16 @@ +# openapi.model.KycShare + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**partnerName** | **String** | | [optional] +**status** | **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/doc/NftCheckoutData.md b/doc/NftCheckoutData.md new file mode 100644 index 0000000..31047ef --- /dev/null +++ b/doc/NftCheckoutData.md @@ -0,0 +1,25 @@ +# openapi.model.NftCheckoutData + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] +**quantity** | **int** | | [optional] +**imageUrl** | **String** | | [optional] +**collectionName** | **String** | | [optional] +**totalPrice** | **String** | | [optional] +**priceCurrency** | **String** | | [optional] +**nftId** | **String** | | [optional] +**collectionId** | **String** | | [optional] +**description** | **String** | | [optional] +**contractAddress** | **String** | | [optional] +**attributes** | [**List>**](Map.md) | | [optional] [default to const []] + +[[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/doc/NftOrdersApi.md b/doc/NftOrdersApi.md new file mode 100644 index 0000000..0f66a1d --- /dev/null +++ b/doc/NftOrdersApi.md @@ -0,0 +1,67 @@ +# openapi.api.NftOrdersApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createNftOrder**](NftOrdersApi.md#createnftorder) | **POST** /nft/orders | Create an NFT Order + + +# **createNftOrder** +> CreateNftOrderResponse createNftOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createNftOrderRequest) + +Create an NFT Order + +Creates a new order for purchasing NFTs. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = NftOrdersApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final createNftOrderRequest = CreateNftOrderRequest(); // CreateNftOrderRequest | NFT Order creation parameters. + +try { + final result = api_instance.createNftOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createNftOrderRequest); + print(result); +} catch (e) { + print('Exception when calling NftOrdersApi->createNftOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **createNftOrderRequest** | [**CreateNftOrderRequest**](CreateNftOrderRequest.md)| NFT Order creation parameters. | + +### Return type + +[**CreateNftOrderResponse**](CreateNftOrderResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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/doc/Order.md b/doc/Order.md new file mode 100644 index 0000000..d5f824b --- /dev/null +++ b/doc/Order.md @@ -0,0 +1,33 @@ +# openapi.model.Order + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | Unique Banxa order ID. | [optional] +**accountReference** | **String** | Your internal reference for the user/account. | [optional] +**orderType** | **String** | Type of order. | [optional] +**fiatCurrency** | **String** | | [optional] +**coinCurrency** | **String** | | [optional] +**fiatAmount** | **String** | | [optional] +**coinAmount** | **String** | | [optional] +**walletAddress** | **String** | | [optional] +**walletAddressTag** | **String** | | [optional] +**blockchain** | **String** | | [optional] +**status** | **String** | Current status of the order. | [optional] +**checkoutUrl** | **String** | URL for the user to complete payment or KYC. | [optional] +**depositAddress** | [**OrderDepositAddress**](OrderDepositAddress.md) | | [optional] +**paymentId** | **String** | | [optional] +**transactionId** | **String** | | [optional] +**paymentMethodId** | **int** | | [optional] +**feeAmount** | **String** | | [optional] +**networkFeeAmount** | **String** | | [optional] +**createdAt** | [**DateTime**](DateTime.md) | Timestamp when the order was created. | [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/doc/OrderDepositAddress.md b/doc/OrderDepositAddress.md new file mode 100644 index 0000000..baff58d --- /dev/null +++ b/doc/OrderDepositAddress.md @@ -0,0 +1,17 @@ +# openapi.model.OrderDepositAddress + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **String** | | [optional] +**memo** | **String** | | [optional] +**uri** | **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/doc/OrdersApi.md b/doc/OrdersApi.md new file mode 100644 index 0000000..f7ebbe9 --- /dev/null +++ b/doc/OrdersApi.md @@ -0,0 +1,189 @@ +# openapi.api.OrdersApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createOrder**](OrdersApi.md#createorder) | **POST** /orders | Create an Order +[**getOrder**](OrdersApi.md#getorder) | **GET** /orders/{order_id} | Retrieve an Order +[**getOrders**](OrdersApi.md#getorders) | **GET** /orders | Retrieve a list of Orders + + +# **createOrder** +> CreateOrderResponse createOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createOrderRequest) + +Create an Order + +Creates a new order (BUY or SELL). For BUY orders, a checkout_url is typically returned. For SELL orders, deposit_address details are returned. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = OrdersApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final createOrderRequest = CreateOrderRequest(); // CreateOrderRequest | Order creation parameters. + +try { + final result = api_instance.createOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createOrderRequest); + print(result); +} catch (e) { + print('Exception when calling OrdersApi->createOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **createOrderRequest** | [**CreateOrderRequest**](CreateOrderRequest.md)| Order creation parameters. | + +### Return type + +[**CreateOrderResponse**](CreateOrderResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + +# **getOrder** +> GetOrderResponse getOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId) + +Retrieve an Order + +Fetches details of a specific order by its Banxa ID. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = OrdersApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final orderId = orderId_example; // String | Unique identifier of the order. + +try { + final result = api_instance.getOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId); + print(result); +} catch (e) { + print('Exception when calling OrdersApi->getOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **orderId** | **String**| Unique identifier of the order. | + +### Return type + +[**GetOrderResponse**](GetOrderResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **getOrders** +> GetOrdersResponse getOrders(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage, startDate, endDate, status, accountReference, orderId, orderType) + +Retrieve a list of Orders + +Fetches a paginated list of orders, filterable by date, status, and account reference. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = OrdersApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. +final startDate = 2013-10-20; // DateTime | Start date for filtering orders (YYYY-MM-DD). +final endDate = 2013-10-20; // DateTime | End date for filtering orders (YYYY-MM-DD). +final status = COMPLETED; // String | Filter orders by status. +final accountReference = accountReference_example; // String | Filter orders by your internal account reference. +final orderId = orderId_example; // String | Filter by a specific Banxa order ID. +final orderType = orderType_example; // String | Filter by order type (e.g., CRYPTO-BUY, CRYPTO-SELL). + +try { + final result = api_instance.getOrders(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage, startDate, endDate, status, accountReference, orderId, orderType); + print(result); +} catch (e) { + print('Exception when calling OrdersApi->getOrders: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **page** | **int**| Page number for pagination. | [optional] [default to 1] + **perPage** | **int**| Number of items per page. | [optional] [default to 25] + **startDate** | **DateTime**| Start date for filtering orders (YYYY-MM-DD). | [optional] + **endDate** | **DateTime**| End date for filtering orders (YYYY-MM-DD). | [optional] + **status** | **String**| Filter orders by status. | [optional] + **accountReference** | **String**| Filter orders by your internal account reference. | [optional] + **orderId** | **String**| Filter by a specific Banxa order ID. | [optional] + **orderType** | **String**| Filter by order type (e.g., CRYPTO-BUY, CRYPTO-SELL). | [optional] + +### Return type + +[**GetOrdersResponse**](GetOrdersResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/Pagination.md b/doc/Pagination.md new file mode 100644 index 0000000..9f1be37 --- /dev/null +++ b/doc/Pagination.md @@ -0,0 +1,18 @@ +# openapi.model.Pagination + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currentPage** | **int** | | [optional] +**recordsPerPage** | **int** | | [optional] +**totalRecords** | **int** | | [optional] +**totalPages** | **int** | | [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/doc/PaymentMethod.md b/doc/PaymentMethod.md new file mode 100644 index 0000000..d4b7ed3 --- /dev/null +++ b/doc/PaymentMethod.md @@ -0,0 +1,33 @@ +# openapi.model.PaymentMethod + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Unique identifier for the payment method. | [optional] +**paymentMethodType** | **String** | Type of payment method. | [optional] +**name** | **String** | Display name of the payment method. | [optional] +**status** | **String** | Status of the payment method. | [optional] +**logoUrl** | **String** | URL of the payment method's logo. | [optional] +**description** | **String** | Description of the payment method. | [optional] +**transactionFees** | [**List**](TransactionFee.md) | | [optional] [default to const []] +**supportedFiat** | **List** | List of supported fiat currency codes. | [optional] [default to const []] +**supportedCoin** | **List** | List of supported coin codes. | [optional] [default to const []] +**minAmount** | **String** | | [optional] +**maxAmount** | **String** | | [optional] +**isCard** | **bool** | | [optional] +**isBankTransfer** | **bool** | | [optional] +**isWallet** | **bool** | | [optional] +**isInstantSettlement** | **bool** | | [optional] +**isPushPayment** | **bool** | | [optional] +**isPullPayment** | **bool** | | [optional] +**countriesAllowed** | **List** | List of ISO 3166-1 alpha-2 country codes where this payment method is allowed. | [optional] [default to const []] +**countriesBlocked** | **List** | List of ISO 3166-1 alpha-2 country codes where this payment method is blocked. | [optional] [default to const []] + +[[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/doc/PaymentMethodsApi.md b/doc/PaymentMethodsApi.md new file mode 100644 index 0000000..b70f63b --- /dev/null +++ b/doc/PaymentMethodsApi.md @@ -0,0 +1,81 @@ +# openapi.api.PaymentMethodsApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getPaymentMethods**](PaymentMethodsApi.md#getpaymentmethods) | **GET** /payment-methods | Retrieve a list of Payment Methods + + +# **getPaymentMethods** +> GetPaymentMethodsResponse getPaymentMethods(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage, source_, target, sourceAmount, targetAmount, paymentMethodType, blockchain) + +Retrieve a list of Payment Methods + +Fetches a paginated list of available payment methods, filterable by currencies and amounts. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = PaymentMethodsApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final page = 56; // int | Page number for pagination. +final perPage = 56; // int | Number of items per page. +final source_ = source__example; // String | Source currency code (e.g., USD). +final target = target_example; // String | Target currency code (e.g., BTC). +final sourceAmount = 3.4; // double | Amount in source currency. +final targetAmount = 3.4; // double | Amount in target currency. +final paymentMethodType = paymentMethodType_example; // String | Filter by payment method type (e.g., CREDIT_CARD). +final blockchain = blockchain_example; // String | Filter by specific blockchain for the target crypto. + +try { + final result = api_instance.getPaymentMethods(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page, perPage, source_, target, sourceAmount, targetAmount, paymentMethodType, blockchain); + print(result); +} catch (e) { + print('Exception when calling PaymentMethodsApi->getPaymentMethods: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **page** | **int**| Page number for pagination. | [optional] [default to 1] + **perPage** | **int**| Number of items per page. | [optional] [default to 25] + **source_** | **String**| Source currency code (e.g., USD). | [optional] + **target** | **String**| Target currency code (e.g., BTC). | [optional] + **sourceAmount** | **double**| Amount in source currency. | [optional] + **targetAmount** | **double**| Amount in target currency. | [optional] + **paymentMethodType** | **String**| Filter by payment method type (e.g., CREDIT_CARD). | [optional] + **blockchain** | **String**| Filter by specific blockchain for the target crypto. | [optional] + +### Return type + +[**GetPaymentMethodsResponse**](GetPaymentMethodsResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/Price.md b/doc/Price.md new file mode 100644 index 0000000..6262eca --- /dev/null +++ b/doc/Price.md @@ -0,0 +1,23 @@ +# openapi.model.Price + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**paymentMethodId** | **int** | ID of the payment method these prices apply to. | [optional] +**spotPriceFee** | **String** | Fee included in the spot price. | [optional] +**spotPriceIncludingFee** | **String** | Spot price including fees. | [optional] +**coinAmount** | **String** | Amount of coin. | [optional] +**coinCode** | **String** | Coin code. | [optional] +**fiatAmount** | **String** | Amount of fiat. | [optional] +**fiatCode** | **String** | Fiat code. | [optional] +**networkFee** | **String** | | [optional] +**blockchainFee** | **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/doc/PricesApi.md b/doc/PricesApi.md new file mode 100644 index 0000000..68103c5 --- /dev/null +++ b/doc/PricesApi.md @@ -0,0 +1,77 @@ +# openapi.api.PricesApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**getPrices**](PricesApi.md#getprices) | **GET** /prices | Retrieve Prices + + +# **getPrices** +> GetPricesResponse getPrices(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, source_, target, sourceAmount, targetAmount, paymentMethodId, blockchain) + +Retrieve Prices + +Fetches current indicative prices for currency pairs and amounts. This is not a frozen quote. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = PricesApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final source_ = source__example; // String | Source currency code (e.g., USD). +final target = target_example; // String | Target currency code (e.g., BTC). +final sourceAmount = 3.4; // double | Amount in source currency. Provide either this or target_amount. +final targetAmount = 3.4; // double | Amount in target currency. Provide either this or source_amount. +final paymentMethodId = 789; // int | Specific payment method ID to get prices for. +final blockchain = blockchain_example; // String | Specific blockchain for the target crypto. + +try { + final result = api_instance.getPrices(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, source_, target, sourceAmount, targetAmount, paymentMethodId, blockchain); + print(result); +} catch (e) { + print('Exception when calling PricesApi->getPrices: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **source_** | **String**| Source currency code (e.g., USD). | + **target** | **String**| Target currency code (e.g., BTC). | + **sourceAmount** | **double**| Amount in source currency. Provide either this or target_amount. | [optional] + **targetAmount** | **double**| Amount in target currency. Provide either this or source_amount. | [optional] + **paymentMethodId** | **int**| Specific payment method ID to get prices for. | [optional] + **blockchain** | **String**| Specific blockchain for the target crypto. | [optional] + +### Return type + +[**GetPricesResponse**](GetPricesResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/Quote.md b/doc/Quote.md new file mode 100644 index 0000000..7b17eae --- /dev/null +++ b/doc/Quote.md @@ -0,0 +1,23 @@ +# openapi.model.Quote + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Unique identifier for the quote. | [optional] +**accountReference** | **String** | Your internal reference for the user/account. | [optional] +**fiatCurrency** | **String** | Fiat currency code involved in the quote. | [optional] +**coinCurrency** | **String** | Coin currency code involved in the quote. | [optional] +**fiatAmount** | **String** | Amount in fiat currency. | [optional] +**coinAmount** | **String** | Amount in coin currency. | [optional] +**expiresAt** | [**DateTime**](DateTime.md) | Timestamp when the quote expires. | [optional] +**createdAt** | [**DateTime**](DateTime.md) | | [optional] +**prices** | [**List**](Price.md) | | [optional] [default to const []] + +[[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/doc/QuotesApi.md b/doc/QuotesApi.md new file mode 100644 index 0000000..d590b8e --- /dev/null +++ b/doc/QuotesApi.md @@ -0,0 +1,121 @@ +# openapi.api.QuotesApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createQuote**](QuotesApi.md#createquote) | **POST** /quotes | Create a Quote +[**getQuote**](QuotesApi.md#getquote) | **GET** /quotes/{id} | Retrieve a Quote + + +# **createQuote** +> CreateQuoteResponse createQuote(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createQuoteRequest) + +Create a Quote + +Creates a new, time-sensitive quote for a currency conversion that can be used to place an order. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = QuotesApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final createQuoteRequest = CreateQuoteRequest(); // CreateQuoteRequest | Quote creation parameters. + +try { + final result = api_instance.createQuote(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createQuoteRequest); + print(result); +} catch (e) { + print('Exception when calling QuotesApi->createQuote: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **createQuoteRequest** | [**CreateQuoteRequest**](CreateQuoteRequest.md)| Quote creation parameters. | + +### Return type + +[**CreateQuoteResponse**](CreateQuoteResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + +# **getQuote** +> GetQuoteResponse getQuote(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, id) + +Retrieve a Quote + +Fetches details of a specific quote by its ID. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = QuotesApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final id = id_example; // String | Unique identifier of the quote. + +try { + final result = api_instance.getQuote(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, id); + print(result); +} catch (e) { + print('Exception when calling QuotesApi->getQuote: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **id** | **String**| Unique identifier of the quote. | + +### Return type + +[**GetQuoteResponse**](GetQuoteResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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/doc/SellOrdersApi.md b/doc/SellOrdersApi.md new file mode 100644 index 0000000..c748dfc --- /dev/null +++ b/doc/SellOrdersApi.md @@ -0,0 +1,69 @@ +# openapi.api.SellOrdersApi + +## Load the API package +```dart +import 'package:openapi/api.dart'; +``` + +All URIs are relative to *https://api.banxa.com/your-partner-id/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**confirmSellOrder**](SellOrdersApi.md#confirmsellorder) | **POST** /orders/{order_id}/sell/confirm | Confirm a Sell Order + + +# **confirmSellOrder** +> ConfirmSellOrderResponse confirmSellOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId, confirmSellOrderRequest) + +Confirm a Sell Order + +Confirms a sell order by providing the transaction hash of the user's crypto deposit. + +### Example +```dart +import 'package:openapi/api.dart'; +// TODO Configure API key authorization: BanxaAuth +//defaultApiClient.getAuthentication('BanxaAuth').apiKey = 'YOUR_API_KEY'; +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//defaultApiClient.getAuthentication('BanxaAuth').apiKeyPrefix = 'Bearer'; + +final api_instance = SellOrdersApi(); +final X_BANXA_SIGNATURE = X_BANXA_SIGNATURE_example; // String | HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). +final X_BANXA_TIMESTAMP = 789; // int | Current UNIX timestamp (seconds). +final X_BANXA_NONCE = X_BANXA_NONCE_example; // String | A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. +final orderId = orderId_example; // String | Unique identifier of the order. +final confirmSellOrderRequest = ConfirmSellOrderRequest(); // ConfirmSellOrderRequest | Sell order confirmation details. + +try { + final result = api_instance.confirmSellOrder(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId, confirmSellOrderRequest); + print(result); +} catch (e) { + print('Exception when calling SellOrdersApi->confirmSellOrder: $e\n'); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **X_BANXA_SIGNATURE** | **String**| HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). | + **X_BANXA_TIMESTAMP** | **int**| Current UNIX timestamp (seconds). | + **X_BANXA_NONCE** | **String**| A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. | + **orderId** | **String**| Unique identifier of the order. | + **confirmSellOrderRequest** | [**ConfirmSellOrderRequest**](ConfirmSellOrderRequest.md)| Sell order confirmation details. | + +### Return type + +[**ConfirmSellOrderResponse**](ConfirmSellOrderResponse.md) + +### Authorization + +[BanxaAuth](../README.md#BanxaAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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/doc/TransactionFee.md b/doc/TransactionFee.md new file mode 100644 index 0000000..39b7b82 --- /dev/null +++ b/doc/TransactionFee.md @@ -0,0 +1,16 @@ +# openapi.model.TransactionFee + +## Load the model package +```dart +import 'package:openapi/api.dart'; +``` + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | Type of fee (e.g., PERCENTAGE, FIXED). | [optional] +**amount** | **String** | Fee amount. | [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/extension_discovery/README.md b/extension_discovery/README.md new file mode 100644 index 0000000..9dc6757 --- /dev/null +++ b/extension_discovery/README.md @@ -0,0 +1,31 @@ +Extension Discovery Cache +========================= + +This folder is used by `package:extension_discovery` to cache lists of +packages that contains extensions for other packages. + +DO NOT USE THIS FOLDER +---------------------- + + * Do not read (or rely) the contents of this folder. + * Do write to this folder. + +If you're interested in the lists of extensions stored in this folder use the +API offered by package `extension_discovery` to get this information. + +If this package doesn't work for your use-case, then don't try to read the +contents of this folder. It may change, and will not remain stable. + +Use package `extension_discovery` +--------------------------------- + +If you want to access information from this folder. + +Feel free to delete this folder +------------------------------- + +Files in this folder act as a cache, and the cache is discarded if the files +are older than the modification time of `.dart_tool/package_config.json`. + +Hence, it should never be necessary to clear this cache manually, if you find a +need to do please file a bug. diff --git a/extension_discovery/vs_code.json b/extension_discovery/vs_code.json new file mode 100644 index 0000000..f69a1b1 --- /dev/null +++ b/extension_discovery/vs_code.json @@ -0,0 +1 @@ +{"version":2,"entries":[{"package":"openapi","rootUri":"../","packageUri":"lib/"}]} \ No newline at end of file diff --git a/git_push.sh b/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/lib/api.dart b/lib/api.dart new file mode 100644 index 0000000..042d006 --- /dev/null +++ b/lib/api.dart @@ -0,0 +1,108 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +library banxa; + +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:collection/collection.dart'; +import 'package:http/http.dart'; +import 'package:intl/intl.dart'; +import 'package:meta/meta.dart'; + +part 'api_client.dart'; +part 'api_helper.dart'; +part 'api_exception.dart'; +part 'auth/authentication.dart'; +part 'auth/api_key_auth.dart'; +part 'auth/oauth.dart'; +part 'auth/http_basic_auth.dart'; +part 'auth/http_bearer_auth.dart'; + +part 'api/coins_api.dart'; +part 'api/countries_api.dart'; +part 'api/fiats_api.dart'; +part 'api/kyc_api.dart'; +part 'api/nft_orders_api.dart'; +part 'api/orders_api.dart'; +part 'api/payment_methods_api.dart'; +part 'api/prices_api.dart'; +part 'api/quotes_api.dart'; +part 'api/sell_orders_api.dart'; + +part 'model/address.dart'; +part 'model/api_error.dart'; +part 'model/api_error_response.dart'; +part 'model/api_error_source.dart'; +part 'model/blockchain.dart'; +part 'model/coin.dart'; +part 'model/confirm_sell_order_data.dart'; +part 'model/confirm_sell_order_request.dart'; +part 'model/confirm_sell_order_response.dart'; +part 'model/country.dart'; +part 'model/create_kyc_account_data.dart'; +part 'model/create_kyc_account_request.dart'; +part 'model/create_kyc_account_response.dart'; +part 'model/create_nft_order_data.dart'; +part 'model/create_nft_order_request.dart'; +part 'model/create_nft_order_response.dart'; +part 'model/create_order_data.dart'; +part 'model/create_order_request.dart'; +part 'model/create_order_response.dart'; +part 'model/create_quote_data.dart'; +part 'model/create_quote_request.dart'; +part 'model/create_quote_response.dart'; +part 'model/fiat.dart'; +part 'model/get_coins_data.dart'; +part 'model/get_coins_response.dart'; +part 'model/get_countries_data.dart'; +part 'model/get_countries_response.dart'; +part 'model/get_fiats_data.dart'; +part 'model/get_fiats_response.dart'; +part 'model/get_kyc_account_data.dart'; +part 'model/get_kyc_account_response.dart'; +part 'model/get_order_data.dart'; +part 'model/get_order_response.dart'; +part 'model/get_orders_data.dart'; +part 'model/get_orders_response.dart'; +part 'model/get_payment_methods_data.dart'; +part 'model/get_payment_methods_response.dart'; +part 'model/get_prices_data.dart'; +part 'model/get_prices_response.dart'; +part 'model/get_quote_data.dart'; +part 'model/get_quote_response.dart'; +part 'model/kyc_account.dart'; +part 'model/kyc_document_image.dart'; +part 'model/kyc_share.dart'; +part 'model/nft_checkout_data.dart'; +part 'model/order.dart'; +part 'model/order_deposit_address.dart'; +part 'model/pagination.dart'; +part 'model/payment_method.dart'; +part 'model/price.dart'; +part 'model/quote.dart'; +part 'model/transaction_fee.dart'; + + +/// An [ApiClient] instance that uses the default values obtained from +/// the OpenAPI specification file. +var defaultApiClient = ApiClient(); + +const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; +const _dateEpochMarker = 'epoch'; +const _deepEquality = DeepCollectionEquality(); +final _dateFormatter = DateFormat('yyyy-MM-dd'); +final _regList = RegExp(r'^List<(.*)>$'); +final _regSet = RegExp(r'^Set<(.*)>$'); +final _regMap = RegExp(r'^Map$'); + +bool _isEpochMarker(String? pattern) => pattern == _dateEpochMarker || pattern == '/$_dateEpochMarker/'; diff --git a/lib/api/coins_api.dart b/lib/api/coins_api.dart new file mode 100644 index 0000000..5129bf9 --- /dev/null +++ b/lib/api/coins_api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class CoinsApi { + CoinsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve a list of Crypto Currencies + /// + /// Fetches a paginated list of all supported crypto currencies and their blockchain details. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getCoinsWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, }) async { + // ignore: prefer_const_declarations + final path = r'/coins'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (page != null) { + queryParams.addAll(_queryParams('', 'page', page)); + } + if (perPage != null) { + queryParams.addAll(_queryParams('', 'per_page', perPage)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a list of Crypto Currencies + /// + /// Fetches a paginated list of all supported crypto currencies and their blockchain details. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getCoins(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, }) async { + final response = await getCoinsWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page: page, perPage: perPage, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetCoinsResponse',) as GetCoinsResponse; + + } + return null; + } +} diff --git a/lib/api/countries_api.dart b/lib/api/countries_api.dart new file mode 100644 index 0000000..f3f8289 --- /dev/null +++ b/lib/api/countries_api.dart @@ -0,0 +1,110 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class CountriesApi { + CountriesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve a list of Countries + /// + /// Fetches a paginated list of supported countries. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getCountriesWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, }) async { + // ignore: prefer_const_declarations + final path = r'/countries'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (page != null) { + queryParams.addAll(_queryParams('', 'page', page)); + } + if (perPage != null) { + queryParams.addAll(_queryParams('', 'per_page', perPage)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a list of Countries + /// + /// Fetches a paginated list of supported countries. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getCountries(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, }) async { + final response = await getCountriesWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page: page, perPage: perPage, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetCountriesResponse',) as GetCountriesResponse; + + } + return null; + } +} diff --git a/lib/api/fiats_api.dart b/lib/api/fiats_api.dart new file mode 100644 index 0000000..fb53669 --- /dev/null +++ b/lib/api/fiats_api.dart @@ -0,0 +1,117 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class FiatsApi { + FiatsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve a list of Fiat Currencies + /// + /// Fetches a paginated list of all supported fiat currencies, filterable by order type (BUY or SELL). + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderType (required): + /// Filter fiats by their availability for 'BUY' or 'SELL' operations. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getFiatsWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderType, { int? page, int? perPage, }) async { + // ignore: prefer_const_declarations + final path = r'/fiats/{orderType}' + .replaceAll('{orderType}', orderType); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (page != null) { + queryParams.addAll(_queryParams('', 'page', page)); + } + if (perPage != null) { + queryParams.addAll(_queryParams('', 'per_page', perPage)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a list of Fiat Currencies + /// + /// Fetches a paginated list of all supported fiat currencies, filterable by order type (BUY or SELL). + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderType (required): + /// Filter fiats by their availability for 'BUY' or 'SELL' operations. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + Future getFiats(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderType, { int? page, int? perPage, }) async { + final response = await getFiatsWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderType, page: page, perPage: perPage, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetFiatsResponse',) as GetFiatsResponse; + + } + return null; + } +} diff --git a/lib/api/kyc_api.dart b/lib/api/kyc_api.dart new file mode 100644 index 0000000..b0884ff --- /dev/null +++ b/lib/api/kyc_api.dart @@ -0,0 +1,178 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class KYCApi { + KYCApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create or Update KYC Account + /// + /// Submits customer KYC information to Banxa for verification. This can create a new KYC application or update an existing one. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateKycAccountRequest] createKycAccountRequest (required): + /// KYC submission details. + Future createKycAccountWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateKycAccountRequest createKycAccountRequest,) async { + // ignore: prefer_const_declarations + final path = r'/kyc/accounts'; + + // ignore: prefer_final_locals + Object? postBody = createKycAccountRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Create or Update KYC Account + /// + /// Submits customer KYC information to Banxa for verification. This can create a new KYC application or update an existing one. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateKycAccountRequest] createKycAccountRequest (required): + /// KYC submission details. + Future createKycAccount(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateKycAccountRequest createKycAccountRequest,) async { + final response = await createKycAccountWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createKycAccountRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateKycAccountResponse',) as CreateKycAccountResponse; + + } + return null; + } + + /// Retrieve KYC Account Details + /// + /// Fetches KYC status and details for a given account reference. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] accountReference (required): + /// Your internal reference for the user/account used during KYC submission. + Future getKycAccountWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String accountReference,) async { + // ignore: prefer_const_declarations + final path = r'/kyc/accounts/{account_reference}' + .replaceAll('{account_reference}', accountReference); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve KYC Account Details + /// + /// Fetches KYC status and details for a given account reference. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] accountReference (required): + /// Your internal reference for the user/account used during KYC submission. + Future getKycAccount(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String accountReference,) async { + final response = await getKycAccountWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, accountReference,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetKycAccountResponse',) as GetKycAccountResponse; + + } + return null; + } +} diff --git a/lib/api/nft_orders_api.dart b/lib/api/nft_orders_api.dart new file mode 100644 index 0000000..37abd6a --- /dev/null +++ b/lib/api/nft_orders_api.dart @@ -0,0 +1,97 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class NftOrdersApi { + NftOrdersApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create an NFT Order + /// + /// Creates a new order for purchasing NFTs. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateNftOrderRequest] createNftOrderRequest (required): + /// NFT Order creation parameters. + Future createNftOrderWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateNftOrderRequest createNftOrderRequest,) async { + // ignore: prefer_const_declarations + final path = r'/nft/orders'; + + // ignore: prefer_final_locals + Object? postBody = createNftOrderRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Create an NFT Order + /// + /// Creates a new order for purchasing NFTs. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateNftOrderRequest] createNftOrderRequest (required): + /// NFT Order creation parameters. + Future createNftOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateNftOrderRequest createNftOrderRequest,) async { + final response = await createNftOrderWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createNftOrderRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateNftOrderResponse',) as CreateNftOrderResponse; + + } + return null; + } +} diff --git a/lib/api/orders_api.dart b/lib/api/orders_api.dart new file mode 100644 index 0000000..b1ef6fa --- /dev/null +++ b/lib/api/orders_api.dart @@ -0,0 +1,325 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class OrdersApi { + OrdersApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create an Order + /// + /// Creates a new order (BUY or SELL). For BUY orders, a checkout_url is typically returned. For SELL orders, deposit_address details are returned. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateOrderRequest] createOrderRequest (required): + /// Order creation parameters. + Future createOrderWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateOrderRequest createOrderRequest,) async { + // ignore: prefer_const_declarations + final path = r'/orders'; + + // ignore: prefer_final_locals + Object? postBody = createOrderRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Create an Order + /// + /// Creates a new order (BUY or SELL). For BUY orders, a checkout_url is typically returned. For SELL orders, deposit_address details are returned. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateOrderRequest] createOrderRequest (required): + /// Order creation parameters. + Future createOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateOrderRequest createOrderRequest,) async { + final response = await createOrderWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createOrderRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateOrderResponse',) as CreateOrderResponse; + + } + return null; + } + + /// Retrieve an Order + /// + /// Fetches details of a specific order by its Banxa ID. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderId (required): + /// Unique identifier of the order. + Future getOrderWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId,) async { + // ignore: prefer_const_declarations + final path = r'/orders/{order_id}' + .replaceAll('{order_id}', orderId); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve an Order + /// + /// Fetches details of a specific order by its Banxa ID. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderId (required): + /// Unique identifier of the order. + Future getOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId,) async { + final response = await getOrderWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetOrderResponse',) as GetOrderResponse; + + } + return null; + } + + /// Retrieve a list of Orders + /// + /// Fetches a paginated list of orders, filterable by date, status, and account reference. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + /// + /// * [DateTime] startDate: + /// Start date for filtering orders (YYYY-MM-DD). + /// + /// * [DateTime] endDate: + /// End date for filtering orders (YYYY-MM-DD). + /// + /// * [String] status: + /// Filter orders by status. + /// + /// * [String] accountReference: + /// Filter orders by your internal account reference. + /// + /// * [String] orderId: + /// Filter by a specific Banxa order ID. + /// + /// * [String] orderType: + /// Filter by order type (e.g., CRYPTO-BUY, CRYPTO-SELL). + Future getOrdersWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, DateTime? startDate, DateTime? endDate, String? status, String? accountReference, String? orderId, String? orderType, }) async { + // ignore: prefer_const_declarations + final path = r'/orders'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (page != null) { + queryParams.addAll(_queryParams('', 'page', page)); + } + if (perPage != null) { + queryParams.addAll(_queryParams('', 'per_page', perPage)); + } + if (startDate != null) { + queryParams.addAll(_queryParams('', 'start_date', startDate)); + } + if (endDate != null) { + queryParams.addAll(_queryParams('', 'end_date', endDate)); + } + if (status != null) { + queryParams.addAll(_queryParams('', 'status', status)); + } + if (accountReference != null) { + queryParams.addAll(_queryParams('', 'account_reference', accountReference)); + } + if (orderId != null) { + queryParams.addAll(_queryParams('', 'order_id', orderId)); + } + if (orderType != null) { + queryParams.addAll(_queryParams('', 'order_type', orderType)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a list of Orders + /// + /// Fetches a paginated list of orders, filterable by date, status, and account reference. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + /// + /// * [DateTime] startDate: + /// Start date for filtering orders (YYYY-MM-DD). + /// + /// * [DateTime] endDate: + /// End date for filtering orders (YYYY-MM-DD). + /// + /// * [String] status: + /// Filter orders by status. + /// + /// * [String] accountReference: + /// Filter orders by your internal account reference. + /// + /// * [String] orderId: + /// Filter by a specific Banxa order ID. + /// + /// * [String] orderType: + /// Filter by order type (e.g., CRYPTO-BUY, CRYPTO-SELL). + Future getOrders(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, DateTime? startDate, DateTime? endDate, String? status, String? accountReference, String? orderId, String? orderType, }) async { + final response = await getOrdersWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page: page, perPage: perPage, startDate: startDate, endDate: endDate, status: status, accountReference: accountReference, orderId: orderId, orderType: orderType, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetOrdersResponse',) as GetOrdersResponse; + + } + return null; + } +} diff --git a/lib/api/payment_methods_api.dart b/lib/api/payment_methods_api.dart new file mode 100644 index 0000000..16f89fe --- /dev/null +++ b/lib/api/payment_methods_api.dart @@ -0,0 +1,164 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class PaymentMethodsApi { + PaymentMethodsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve a list of Payment Methods + /// + /// Fetches a paginated list of available payment methods, filterable by currencies and amounts. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + /// + /// * [String] source_: + /// Source currency code (e.g., USD). + /// + /// * [String] target: + /// Target currency code (e.g., BTC). + /// + /// * [double] sourceAmount: + /// Amount in source currency. + /// + /// * [double] targetAmount: + /// Amount in target currency. + /// + /// * [String] paymentMethodType: + /// Filter by payment method type (e.g., CREDIT_CARD). + /// + /// * [String] blockchain: + /// Filter by specific blockchain for the target crypto. + Future getPaymentMethodsWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, String? source_, String? target, double? sourceAmount, double? targetAmount, String? paymentMethodType, String? blockchain, }) async { + // ignore: prefer_const_declarations + final path = r'/payment-methods'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + if (page != null) { + queryParams.addAll(_queryParams('', 'page', page)); + } + if (perPage != null) { + queryParams.addAll(_queryParams('', 'per_page', perPage)); + } + if (source_ != null) { + queryParams.addAll(_queryParams('', 'source', source_)); + } + if (target != null) { + queryParams.addAll(_queryParams('', 'target', target)); + } + if (sourceAmount != null) { + queryParams.addAll(_queryParams('', 'source_amount', sourceAmount)); + } + if (targetAmount != null) { + queryParams.addAll(_queryParams('', 'target_amount', targetAmount)); + } + if (paymentMethodType != null) { + queryParams.addAll(_queryParams('', 'payment_method_type', paymentMethodType)); + } + if (blockchain != null) { + queryParams.addAll(_queryParams('', 'blockchain', blockchain)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a list of Payment Methods + /// + /// Fetches a paginated list of available payment methods, filterable by currencies and amounts. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [int] page: + /// Page number for pagination. + /// + /// * [int] perPage: + /// Number of items per page. + /// + /// * [String] source_: + /// Source currency code (e.g., USD). + /// + /// * [String] target: + /// Target currency code (e.g., BTC). + /// + /// * [double] sourceAmount: + /// Amount in source currency. + /// + /// * [double] targetAmount: + /// Amount in target currency. + /// + /// * [String] paymentMethodType: + /// Filter by payment method type (e.g., CREDIT_CARD). + /// + /// * [String] blockchain: + /// Filter by specific blockchain for the target crypto. + Future getPaymentMethods(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int? page, int? perPage, String? source_, String? target, double? sourceAmount, double? targetAmount, String? paymentMethodType, String? blockchain, }) async { + final response = await getPaymentMethodsWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, page: page, perPage: perPage, source_: source_, target: target, sourceAmount: sourceAmount, targetAmount: targetAmount, paymentMethodType: paymentMethodType, blockchain: blockchain, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetPaymentMethodsResponse',) as GetPaymentMethodsResponse; + + } + return null; + } +} diff --git a/lib/api/prices_api.dart b/lib/api/prices_api.dart new file mode 100644 index 0000000..bdadb05 --- /dev/null +++ b/lib/api/prices_api.dart @@ -0,0 +1,142 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class PricesApi { + PricesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Retrieve Prices + /// + /// Fetches current indicative prices for currency pairs and amounts. This is not a frozen quote. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] source_ (required): + /// Source currency code (e.g., USD). + /// + /// * [String] target (required): + /// Target currency code (e.g., BTC). + /// + /// * [double] sourceAmount: + /// Amount in source currency. Provide either this or target_amount. + /// + /// * [double] targetAmount: + /// Amount in target currency. Provide either this or source_amount. + /// + /// * [int] paymentMethodId: + /// Specific payment method ID to get prices for. + /// + /// * [String] blockchain: + /// Specific blockchain for the target crypto. + Future getPricesWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String source_, String target, { double? sourceAmount, double? targetAmount, int? paymentMethodId, String? blockchain, }) async { + // ignore: prefer_const_declarations + final path = r'/prices'; + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + queryParams.addAll(_queryParams('', 'source', source_)); + queryParams.addAll(_queryParams('', 'target', target)); + if (sourceAmount != null) { + queryParams.addAll(_queryParams('', 'source_amount', sourceAmount)); + } + if (targetAmount != null) { + queryParams.addAll(_queryParams('', 'target_amount', targetAmount)); + } + if (paymentMethodId != null) { + queryParams.addAll(_queryParams('', 'payment_method_id', paymentMethodId)); + } + if (blockchain != null) { + queryParams.addAll(_queryParams('', 'blockchain', blockchain)); + } + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve Prices + /// + /// Fetches current indicative prices for currency pairs and amounts. This is not a frozen quote. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] source_ (required): + /// Source currency code (e.g., USD). + /// + /// * [String] target (required): + /// Target currency code (e.g., BTC). + /// + /// * [double] sourceAmount: + /// Amount in source currency. Provide either this or target_amount. + /// + /// * [double] targetAmount: + /// Amount in target currency. Provide either this or source_amount. + /// + /// * [int] paymentMethodId: + /// Specific payment method ID to get prices for. + /// + /// * [String] blockchain: + /// Specific blockchain for the target crypto. + Future getPrices(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String source_, String target, { double? sourceAmount, double? targetAmount, int? paymentMethodId, String? blockchain, }) async { + final response = await getPricesWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, source_, target, sourceAmount: sourceAmount, targetAmount: targetAmount, paymentMethodId: paymentMethodId, blockchain: blockchain, ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetPricesResponse',) as GetPricesResponse; + + } + return null; + } +} diff --git a/lib/api/quotes_api.dart b/lib/api/quotes_api.dart new file mode 100644 index 0000000..2d038cc --- /dev/null +++ b/lib/api/quotes_api.dart @@ -0,0 +1,178 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class QuotesApi { + QuotesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Create a Quote + /// + /// Creates a new, time-sensitive quote for a currency conversion that can be used to place an order. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateQuoteRequest] createQuoteRequest (required): + /// Quote creation parameters. + Future createQuoteWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateQuoteRequest createQuoteRequest,) async { + // ignore: prefer_const_declarations + final path = r'/quotes'; + + // ignore: prefer_final_locals + Object? postBody = createQuoteRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Create a Quote + /// + /// Creates a new, time-sensitive quote for a currency conversion that can be used to place an order. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [CreateQuoteRequest] createQuoteRequest (required): + /// Quote creation parameters. + Future createQuote(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateQuoteRequest createQuoteRequest,) async { + final response = await createQuoteWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, createQuoteRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreateQuoteResponse',) as CreateQuoteResponse; + + } + return null; + } + + /// Retrieve a Quote + /// + /// Fetches details of a specific quote by its ID. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] id (required): + /// Unique identifier of the quote. + Future getQuoteWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String id,) async { + // ignore: prefer_const_declarations + final path = r'/quotes/{id}' + .replaceAll('{id}', id); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = []; + + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Retrieve a Quote + /// + /// Fetches details of a specific quote by its ID. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] id (required): + /// Unique identifier of the quote. + Future getQuote(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String id,) async { + final response = await getQuoteWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, id,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'GetQuoteResponse',) as GetQuoteResponse; + + } + return null; + } +} diff --git a/lib/api/sell_orders_api.dart b/lib/api/sell_orders_api.dart new file mode 100644 index 0000000..5f5b053 --- /dev/null +++ b/lib/api/sell_orders_api.dart @@ -0,0 +1,104 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; + +class SellOrdersApi { + SellOrdersApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Confirm a Sell Order + /// + /// Confirms a sell order by providing the transaction hash of the user's crypto deposit. + /// + /// Note: This method returns the HTTP [Response]. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderId (required): + /// Unique identifier of the order. + /// + /// * [ConfirmSellOrderRequest] confirmSellOrderRequest (required): + /// Sell order confirmation details. + Future confirmSellOrderWithHttpInfo(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId, ConfirmSellOrderRequest confirmSellOrderRequest,) async { + // ignore: prefer_const_declarations + final path = r'/orders/{order_id}/sell/confirm' + .replaceAll('{order_id}', orderId); + + // ignore: prefer_final_locals + Object? postBody = confirmSellOrderRequest; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + headerParams[r'X-BANXA-SIGNATURE'] = parameterToString(X_BANXA_SIGNATURE); + headerParams[r'X-BANXA-TIMESTAMP'] = parameterToString(X_BANXA_TIMESTAMP); + headerParams[r'X-BANXA-NONCE'] = parameterToString(X_BANXA_NONCE); + + const contentTypes = ['application/json']; + + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + /// Confirm a Sell Order + /// + /// Confirms a sell order by providing the transaction hash of the user's crypto deposit. + /// + /// Parameters: + /// + /// * [String] X_BANXA_SIGNATURE (required): + /// HMAC-SHA256 signature of (HTTP_METHOD + REQUEST_URI + REQUEST_BODY + CURRENT_UNIX_TIMESTAMP + NONCE). + /// + /// * [int] X_BANXA_TIMESTAMP (required): + /// Current UNIX timestamp (seconds). + /// + /// * [String] X_BANXA_NONCE (required): + /// A unique, randomly generated string for each request (e.g., UUID). Max 255 chars. + /// + /// * [String] orderId (required): + /// Unique identifier of the order. + /// + /// * [ConfirmSellOrderRequest] confirmSellOrderRequest (required): + /// Sell order confirmation details. + Future confirmSellOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId, ConfirmSellOrderRequest confirmSellOrderRequest,) async { + final response = await confirmSellOrderWithHttpInfo(X_BANXA_SIGNATURE, X_BANXA_TIMESTAMP, X_BANXA_NONCE, orderId, confirmSellOrderRequest,); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + // When a remote server returns no body with a status of 204, we shall not decode it. + // At the time of writing this, `dart:convert` will throw an "Unexpected end of input" + // FormatException when trying to decode an empty string. + if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfirmSellOrderResponse',) as ConfirmSellOrderResponse; + + } + return null; + } +} diff --git a/lib/api_client.dart b/lib/api_client.dart new file mode 100644 index 0000000..213b296 --- /dev/null +++ b/lib/api_client.dart @@ -0,0 +1,359 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiClient { + ApiClient({this.basePath = 'https://api.banxa.com/your-partner-id/v2', this.authentication,}); + + final String basePath; + final Authentication? authentication; + + var _client = Client(); + final _defaultHeaderMap = {}; + + /// Returns the current HTTP [Client] instance to use in this class. + /// + /// The return value is guaranteed to never be null. + Client get client => _client; + + /// Requests to use a new HTTP [Client] in this class. + set client(Client newClient) { + _client = newClient; + } + + Map get defaultHeaderMap => _defaultHeaderMap; + + void addDefaultHeader(String key, String value) { + _defaultHeaderMap[key] = value; + } + + // We don't use a Map for queryParams. + // If collectionFormat is 'multi', a key might appear multiple times. + Future invokeAPI( + String path, + String method, + List queryParams, + Object? body, + Map headerParams, + Map formParams, + String? contentType, + ) async { + await authentication?.applyToParams(queryParams, headerParams); + + headerParams.addAll(_defaultHeaderMap); + if (contentType != null) { + headerParams['Content-Type'] = contentType; + } + + final urlEncodedQueryParams = queryParams.map((param) => '$param'); + final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : ''; + final uri = Uri.parse('$basePath$path$queryString'); + + try { + // Special case for uploading a single file which isn't a 'multipart/form-data'. + if ( + body is MultipartFile && (contentType == null || + !contentType.toLowerCase().startsWith('multipart/form-data')) + ) { + final request = StreamedRequest(method, uri); + request.headers.addAll(headerParams); + request.contentLength = body.length; + body.finalize().listen( + request.sink.add, + onDone: request.sink.close, + // ignore: avoid_types_on_closure_parameters + onError: (Object error, StackTrace trace) => request.sink.close(), + cancelOnError: true, + ); + final response = await _client.send(request); + return Response.fromStream(response); + } + + if (body is MultipartRequest) { + final request = MultipartRequest(method, uri); + request.fields.addAll(body.fields); + request.files.addAll(body.files); + request.headers.addAll(body.headers); + request.headers.addAll(headerParams); + final response = await _client.send(request); + return Response.fromStream(response); + } + + final msgBody = contentType == 'application/x-www-form-urlencoded' + ? formParams + : await serializeAsync(body); + final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; + + switch(method) { + case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,); + case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,); + case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,); + case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,); + case 'GET': return await _client.get(uri, headers: nullableHeaderParams,); + } + } on SocketException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Socket operation failed: $method $path', + error, + trace, + ); + } on TlsException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'TLS/SSL communication failed: $method $path', + error, + trace, + ); + } on IOException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'I/O operation failed: $method $path', + error, + trace, + ); + } on ClientException catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'HTTP connection failed: $method $path', + error, + trace, + ); + } on Exception catch (error, trace) { + throw ApiException.withInner( + HttpStatus.badRequest, + 'Exception occurred: $method $path', + error, + trace, + ); + } + + throw ApiException( + HttpStatus.badRequest, + 'Invalid HTTP operation: $method $path', + ); + } + + Future deserializeAsync(String value, String targetType, {bool growable = false,}) async => + // ignore: deprecated_member_use_from_same_package + deserialize(value, targetType, growable: growable); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.') + dynamic deserialize(String value, String targetType, {bool growable = false,}) { + // Remove all spaces. Necessary for regular expressions as well. + targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? value + : fromJson(json.decode(value), targetType, growable: growable); + } + + // ignore: deprecated_member_use_from_same_package + Future serializeAsync(Object? value) async => serialize(value); + + @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.') + String serialize(Object? value) => value == null ? '' : json.encode(value); + + /// Returns a native instance of an OpenAPI class matching the [specified type][targetType]. + static dynamic fromJson(dynamic value, String targetType, {bool growable = false,}) { + try { + switch (targetType) { + case 'String': + return value is String ? value : value.toString(); + case 'int': + return value is int ? value : int.tryParse('$value'); + case 'double': + return value is double ? value : double.tryParse('$value'); + case 'bool': + if (value is bool) { + return value; + } + final valueString = '$value'.toLowerCase(); + return valueString == 'true' || valueString == '1'; + case 'DateTime': + return value is DateTime ? value : DateTime.tryParse(value); + case 'Address': + return Address.fromJson(value); + case 'ApiError': + return ApiError.fromJson(value); + case 'ApiErrorResponse': + return ApiErrorResponse.fromJson(value); + case 'ApiErrorSource': + return ApiErrorSource.fromJson(value); + case 'Blockchain': + return Blockchain.fromJson(value); + case 'Coin': + return Coin.fromJson(value); + case 'ConfirmSellOrderData': + return ConfirmSellOrderData.fromJson(value); + case 'ConfirmSellOrderRequest': + return ConfirmSellOrderRequest.fromJson(value); + case 'ConfirmSellOrderResponse': + return ConfirmSellOrderResponse.fromJson(value); + case 'Country': + return Country.fromJson(value); + case 'CreateKycAccountData': + return CreateKycAccountData.fromJson(value); + case 'CreateKycAccountRequest': + return CreateKycAccountRequest.fromJson(value); + case 'CreateKycAccountResponse': + return CreateKycAccountResponse.fromJson(value); + case 'CreateNftOrderData': + return CreateNftOrderData.fromJson(value); + case 'CreateNftOrderRequest': + return CreateNftOrderRequest.fromJson(value); + case 'CreateNftOrderResponse': + return CreateNftOrderResponse.fromJson(value); + case 'CreateOrderData': + return CreateOrderData.fromJson(value); + case 'CreateOrderRequest': + return CreateOrderRequest.fromJson(value); + case 'CreateOrderResponse': + return CreateOrderResponse.fromJson(value); + case 'CreateQuoteData': + return CreateQuoteData.fromJson(value); + case 'CreateQuoteRequest': + return CreateQuoteRequest.fromJson(value); + case 'CreateQuoteResponse': + return CreateQuoteResponse.fromJson(value); + case 'Fiat': + return Fiat.fromJson(value); + case 'GetCoinsData': + return GetCoinsData.fromJson(value); + case 'GetCoinsResponse': + return GetCoinsResponse.fromJson(value); + case 'GetCountriesData': + return GetCountriesData.fromJson(value); + case 'GetCountriesResponse': + return GetCountriesResponse.fromJson(value); + case 'GetFiatsData': + return GetFiatsData.fromJson(value); + case 'GetFiatsResponse': + return GetFiatsResponse.fromJson(value); + case 'GetKycAccountData': + return GetKycAccountData.fromJson(value); + case 'GetKycAccountResponse': + return GetKycAccountResponse.fromJson(value); + case 'GetOrderData': + return GetOrderData.fromJson(value); + case 'GetOrderResponse': + return GetOrderResponse.fromJson(value); + case 'GetOrdersData': + return GetOrdersData.fromJson(value); + case 'GetOrdersResponse': + return GetOrdersResponse.fromJson(value); + case 'GetPaymentMethodsData': + return GetPaymentMethodsData.fromJson(value); + case 'GetPaymentMethodsResponse': + return GetPaymentMethodsResponse.fromJson(value); + case 'GetPricesData': + return GetPricesData.fromJson(value); + case 'GetPricesResponse': + return GetPricesResponse.fromJson(value); + case 'GetQuoteData': + return GetQuoteData.fromJson(value); + case 'GetQuoteResponse': + return GetQuoteResponse.fromJson(value); + case 'KycAccount': + return KycAccount.fromJson(value); + case 'KycDocumentImage': + return KycDocumentImage.fromJson(value); + case 'KycShare': + return KycShare.fromJson(value); + case 'NftCheckoutData': + return NftCheckoutData.fromJson(value); + case 'Order': + return Order.fromJson(value); + case 'OrderDepositAddress': + return OrderDepositAddress.fromJson(value); + case 'Pagination': + return Pagination.fromJson(value); + case 'PaymentMethod': + return PaymentMethod.fromJson(value); + case 'Price': + return Price.fromJson(value); + case 'Quote': + return Quote.fromJson(value); + case 'TransactionFee': + return TransactionFee.fromJson(value); + default: + dynamic match; + if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => fromJson(v, match, growable: growable,)) + .toList(growable: growable); + } + if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) { + return value + .map((dynamic v) => fromJson(v, match, growable: growable,)) + .toSet(); + } + if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) { + return Map.fromIterables( + value.keys.cast(), + value.values.map((dynamic v) => fromJson(v, match, growable: growable,)), + ); + } + } + } on Exception catch (error, trace) { + throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,); + } + throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); + } +} + +/// Primarily intended for use in an isolate. +class DeserializationMessage { + const DeserializationMessage({ + required this.json, + required this.targetType, + this.growable = false, + }); + + /// The JSON value to deserialize. + final String json; + + /// Target type to deserialize to. + final String targetType; + + /// Whether to make deserialized lists or maps growable. + final bool growable; +} + +/// Primarily intended for use in an isolate. +Future decodeAsync(DeserializationMessage message) async { + // Remove all spaces. Necessary for regular expressions as well. + final targetType = message.targetType.replaceAll(' ', ''); + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? message.json + : json.decode(message.json); +} + +/// Primarily intended for use in an isolate. +Future deserializeAsync(DeserializationMessage message) async { + // Remove all spaces. Necessary for regular expressions as well. + final targetType = message.targetType.replaceAll(' ', ''); + + // If the expected target type is String, nothing to do... + return targetType == 'String' + ? message.json + : ApiClient.fromJson( + json.decode(message.json), + targetType, + growable: message.growable, + ); +} + +/// Primarily intended for use in an isolate. +Future serializeAsync(Object? value) async => value == null ? '' : json.encode(value); diff --git a/lib/api_exception.dart b/lib/api_exception.dart new file mode 100644 index 0000000..a377bcf --- /dev/null +++ b/lib/api_exception.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiException implements Exception { + ApiException(this.code, this.message); + + ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); + + int code = 0; + String? message; + Exception? innerException; + StackTrace? stackTrace; + + @override + String toString() { + if (message == null) { + return 'ApiException'; + } + if (innerException == null) { + return 'ApiException $code: $message'; + } + return 'ApiException $code: $message (Inner exception: $innerException)\n\n$stackTrace'; + } +} diff --git a/lib/api_helper.dart b/lib/api_helper.dart new file mode 100644 index 0000000..884e6b6 --- /dev/null +++ b/lib/api_helper.dart @@ -0,0 +1,103 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class QueryParam { + const QueryParam(this.name, this.value); + + final String name; + final String value; + + @override + String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}'; +} + +// Ported from the Java version. +Iterable _queryParams(String collectionFormat, String name, dynamic value,) { + // Assertions to run in debug mode only. + assert(name.isNotEmpty, 'Parameter cannot be an empty string.'); + + final params = []; + + if (value is List) { + if (collectionFormat == 'multi') { + return value.map((dynamic v) => QueryParam(name, parameterToString(v)),); + } + + // Default collection format is 'csv'. + if (collectionFormat.isEmpty) { + collectionFormat = 'csv'; // ignore: parameter_assignments + } + + final delimiter = _delimiters[collectionFormat] ?? ','; + + params.add(QueryParam(name, value.map(parameterToString).join(delimiter),)); + } else if (value != null) { + params.add(QueryParam(name, parameterToString(value))); + } + + return params; +} + +/// Format the given parameter object into a [String]. +String parameterToString(dynamic value) { + if (value == null) { + return ''; + } + if (value is DateTime) { + return value.toUtc().toIso8601String(); + } + return value.toString(); +} + +/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' +/// content type. Otherwise, returns the decoded body as decoded by dart:http package. +Future _decodeBodyBytes(Response response) async { + final contentType = response.headers['content-type']; + return contentType != null && contentType.toLowerCase().startsWith('application/json') + ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes) + : response.body; +} + +/// Returns a valid [T] value found at the specified Map [key], null otherwise. +T? mapValueOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + if (T == double && value is int) { + return value.toDouble() as T; + } + return value is T ? value : null; +} + +/// Returns a valid Map found at the specified Map [key], null otherwise. +Map? mapCastOfType(dynamic map, String key) { + final dynamic value = map is Map ? map[key] : null; + return value is Map ? value.cast() : null; +} + +/// Returns a valid [DateTime] found at the specified Map [key], null otherwise. +DateTime? mapDateTime(dynamic map, String key, [String? pattern]) { + final dynamic value = map is Map ? map[key] : null; + if (value != null) { + int? millis; + if (value is int) { + millis = value; + } else if (value is String) { + if (_isEpochMarker(pattern)) { + millis = int.parse(value); + } else { + return DateTime.parse(value); + } + } + if (millis != null) { + return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true); + } + } + return null; +} diff --git a/lib/auth/api_key_auth.dart b/lib/auth/api_key_auth.dart new file mode 100644 index 0000000..4a72ad0 --- /dev/null +++ b/lib/auth/api_key_auth.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiKeyAuth implements Authentication { + ApiKeyAuth(this.location, this.paramName); + + final String location; + final String paramName; + + String apiKeyPrefix = ''; + String apiKey = ''; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey'; + + if (paramValue.isNotEmpty) { + if (location == 'query') { + queryParams.add(QueryParam(paramName, paramValue)); + } else if (location == 'header') { + headerParams[paramName] = paramValue; + } else if (location == 'cookie') { + headerParams.update( + 'Cookie', + (existingCookie) => '$existingCookie; $paramName=$paramValue', + ifAbsent: () => '$paramName=$paramValue', + ); + } + } + } +} diff --git a/lib/auth/authentication.dart b/lib/auth/authentication.dart new file mode 100644 index 0000000..d1d7aa3 --- /dev/null +++ b/lib/auth/authentication.dart @@ -0,0 +1,16 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +// ignore: one_member_abstracts +abstract class Authentication { + /// Apply authentication settings to header and query params. + Future applyToParams(List queryParams, Map headerParams); +} diff --git a/lib/auth/http_basic_auth.dart b/lib/auth/http_basic_auth.dart new file mode 100644 index 0000000..5c2e79d --- /dev/null +++ b/lib/auth/http_basic_auth.dart @@ -0,0 +1,25 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class HttpBasicAuth implements Authentication { + HttpBasicAuth({this.username = '', this.password = ''}); + + String username; + String password; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (username.isNotEmpty && password.isNotEmpty) { + final credentials = '$username:$password'; + headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; + } + } +} diff --git a/lib/auth/http_bearer_auth.dart b/lib/auth/http_bearer_auth.dart new file mode 100644 index 0000000..afb97e1 --- /dev/null +++ b/lib/auth/http_bearer_auth.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +typedef HttpBearerAuthProvider = String Function(); + +class HttpBearerAuth implements Authentication { + HttpBearerAuth(); + + dynamic _accessToken; + + dynamic get accessToken => _accessToken; + + set accessToken(dynamic accessToken) { + if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { + throw ArgumentError('accessToken value must be either a String or a String Function().'); + } + _accessToken = accessToken; + } + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (_accessToken == null) { + return; + } + + String accessToken; + + if (_accessToken is String) { + accessToken = _accessToken; + } else if (_accessToken is HttpBearerAuthProvider) { + accessToken = _accessToken!(); + } else { + return; + } + + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/lib/auth/oauth.dart b/lib/auth/oauth.dart new file mode 100644 index 0000000..a60a979 --- /dev/null +++ b/lib/auth/oauth.dart @@ -0,0 +1,23 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class OAuth implements Authentication { + OAuth({this.accessToken = ''}); + + String accessToken; + + @override + Future applyToParams(List queryParams, Map headerParams,) async { + if (accessToken.isNotEmpty) { + headerParams['Authorization'] = 'Bearer $accessToken'; + } + } +} diff --git a/lib/model/address.dart b/lib/model/address.dart new file mode 100644 index 0000000..46881b6 --- /dev/null +++ b/lib/model/address.dart @@ -0,0 +1,152 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Address { + /// Returns a new [Address] instance. + Address({ + required this.street1, + this.street2, + required this.suburbCity, + this.stateProvince, + required this.postCodeZip, + required this.countryCode, + }); + String street1; + + String? street2; + + String suburbCity; + + String? stateProvince; + + String postCodeZip; + + String countryCode; + + @override + bool operator ==(Object other) => identical(this, other) || other is Address && + other.street1 == street1 && + other.street2 == street2 && + other.suburbCity == suburbCity && + other.stateProvince == stateProvince && + other.postCodeZip == postCodeZip && + other.countryCode == countryCode; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (street1.hashCode) + + (street2 == null ? 0 : street2!.hashCode) + + (suburbCity.hashCode) + + (stateProvince == null ? 0 : stateProvince!.hashCode) + + (postCodeZip.hashCode) + + (countryCode.hashCode); + + @override + String toString() => 'Address[street1=$street1, street2=$street2, suburbCity=$suburbCity, stateProvince=$stateProvince, postCodeZip=$postCodeZip, countryCode=$countryCode]'; + + Map toJson() { + final json = {}; + json[r'street1'] = this.street1; + if (this.street2 != null) { + json[r'street2'] = this.street2; + } else { + json[r'street2'] = null; + } + json[r'suburb_city'] = this.suburbCity; + if (this.stateProvince != null) { + json[r'state_province'] = this.stateProvince; + } else { + json[r'state_province'] = null; + } + json[r'post_code_zip'] = this.postCodeZip; + json[r'country_code'] = this.countryCode; + return json; + } + + /// Returns a new [Address] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Address? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Address[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Address[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Address( + street1: mapValueOfType(json, r'street1')!, + street2: mapValueOfType(json, r'street2'), + suburbCity: mapValueOfType(json, r'suburb_city')!, + stateProvince: mapValueOfType(json, r'state_province'), + postCodeZip: mapValueOfType(json, r'post_code_zip')!, + countryCode: mapValueOfType(json, r'country_code')!, + ); + } + return null; + } + + static List
listFromJson(dynamic json, {bool growable = false,}) { + final result =
[]; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Address.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Address.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Address-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Address.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'street1', + 'suburb_city', + 'post_code_zip', + 'country_code', + }; +} diff --git a/lib/model/api_error.dart b/lib/model/api_error.dart new file mode 100644 index 0000000..93445ad --- /dev/null +++ b/lib/model/api_error.dart @@ -0,0 +1,177 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiError { + /// Returns a new [ApiError] instance. + ApiError({ + this.status, + this.title, + this.detail, + this.code, + this.source_, + }); + /// The HTTP status code applicable to this problem, expressed as a string value. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + /// A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? title; + + /// A human-readable explanation specific to this occurrence of the problem. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? detail; + + /// A Banxa-specific error code. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? code; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + ApiErrorSource? source_; + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiError && + other.status == status && + other.title == title && + other.detail == detail && + other.code == code && + other.source_ == source_; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (status == null ? 0 : status!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (detail == null ? 0 : detail!.hashCode) + + (code == null ? 0 : code!.hashCode) + + (source_ == null ? 0 : source_!.hashCode); + + @override + String toString() => 'ApiError[status=$status, title=$title, detail=$detail, code=$code, source_=$source_]'; + + Map toJson() { + final json = {}; + if (this.status != null) { + json[r'status'] = this.status; + } + if (this.title != null) { + json[r'title'] = this.title; + } + if (this.detail != null) { + json[r'detail'] = this.detail; + } + if (this.code != null) { + json[r'code'] = this.code; + } + if (this.source_ != null) { + json[r'source'] = this.source_; + } + return json; + } + + /// Returns a new [ApiError] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApiError? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ApiError[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ApiError[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApiError( + status: mapValueOfType(json, r'status'), + title: mapValueOfType(json, r'title'), + detail: mapValueOfType(json, r'detail'), + code: mapValueOfType(json, r'code'), + source_: ApiErrorSource.fromJson(json[r'source']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ApiError.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ApiError.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApiError-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ApiError.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/api_error_response.dart b/lib/model/api_error_response.dart new file mode 100644 index 0000000..e50043d --- /dev/null +++ b/lib/model/api_error_response.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiErrorResponse { + /// Returns a new [ApiErrorResponse] instance. + ApiErrorResponse({ + this.errors = const [], + }); + List errors; + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiErrorResponse && + _deepEquality.equals(other.errors, errors); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (errors.hashCode); + + @override + String toString() => 'ApiErrorResponse[errors=$errors]'; + + Map toJson() { + final json = {}; + json[r'errors'] = this.errors; + return json; + } + + /// Returns a new [ApiErrorResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApiErrorResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ApiErrorResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ApiErrorResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApiErrorResponse( + errors: ApiError.listFromJson(json[r'errors']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ApiErrorResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ApiErrorResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApiErrorResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ApiErrorResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'errors', + }; +} diff --git a/lib/model/api_error_source.dart b/lib/model/api_error_source.dart new file mode 100644 index 0000000..84268b0 --- /dev/null +++ b/lib/model/api_error_source.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ApiErrorSource { + /// Returns a new [ApiErrorSource] instance. + ApiErrorSource({ + this.pointer, + this.parameter, + }); + /// A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. \"/data\" for a primary data object, or \"/data/attributes/title\" for a specific attribute]. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? pointer; + + /// A string indicating which URI query parameter caused the error. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? parameter; + + @override + bool operator ==(Object other) => identical(this, other) || other is ApiErrorSource && + other.pointer == pointer && + other.parameter == parameter; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pointer == null ? 0 : pointer!.hashCode) + + (parameter == null ? 0 : parameter!.hashCode); + + @override + String toString() => 'ApiErrorSource[pointer=$pointer, parameter=$parameter]'; + + Map toJson() { + final json = {}; + if (this.pointer != null) { + json[r'pointer'] = this.pointer; + } + if (this.parameter != null) { + json[r'parameter'] = this.parameter; + } + return json; + } + + /// Returns a new [ApiErrorSource] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ApiErrorSource? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ApiErrorSource[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ApiErrorSource[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ApiErrorSource( + pointer: mapValueOfType(json, r'pointer'), + parameter: mapValueOfType(json, r'parameter'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ApiErrorSource.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ApiErrorSource.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ApiErrorSource-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ApiErrorSource.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/blockchain.dart b/lib/model/blockchain.dart new file mode 100644 index 0000000..b129db0 --- /dev/null +++ b/lib/model/blockchain.dart @@ -0,0 +1,188 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Blockchain { + /// Returns a new [Blockchain] instance. + Blockchain({ + this.code, + this.description, + this.isDefault, + this.withdrawalFee, + this.depositFee, + this.minWithdrawal, + this.type, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? code; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? description; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isDefault; + + String? withdrawalFee; + + String? depositFee; + + String? minWithdrawal; + + /// Type of blockchain (e.g. MAINNET) + String? type; + + @override + bool operator ==(Object other) => identical(this, other) || other is Blockchain && + other.code == code && + other.description == description && + other.isDefault == isDefault && + other.withdrawalFee == withdrawalFee && + other.depositFee == depositFee && + other.minWithdrawal == minWithdrawal && + other.type == type; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (code == null ? 0 : code!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (isDefault == null ? 0 : isDefault!.hashCode) + + (withdrawalFee == null ? 0 : withdrawalFee!.hashCode) + + (depositFee == null ? 0 : depositFee!.hashCode) + + (minWithdrawal == null ? 0 : minWithdrawal!.hashCode) + + (type == null ? 0 : type!.hashCode); + + @override + String toString() => 'Blockchain[code=$code, description=$description, isDefault=$isDefault, withdrawalFee=$withdrawalFee, depositFee=$depositFee, minWithdrawal=$minWithdrawal, type=$type]'; + + Map toJson() { + final json = {}; + if (this.code != null) { + json[r'code'] = this.code; + } + if (this.description != null) { + json[r'description'] = this.description; + } + if (this.isDefault != null) { + json[r'is_default'] = this.isDefault; + } + if (this.withdrawalFee != null) { + json[r'withdrawal_fee'] = this.withdrawalFee; + } else { + json[r'withdrawal_fee'] = null; + } + if (this.depositFee != null) { + json[r'deposit_fee'] = this.depositFee; + } else { + json[r'deposit_fee'] = null; + } + if (this.minWithdrawal != null) { + json[r'min_withdrawal'] = this.minWithdrawal; + } else { + json[r'min_withdrawal'] = null; + } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + return json; + } + + /// Returns a new [Blockchain] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Blockchain? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Blockchain[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Blockchain[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Blockchain( + code: mapValueOfType(json, r'code'), + description: mapValueOfType(json, r'description'), + isDefault: mapValueOfType(json, r'is_default'), + withdrawalFee: mapValueOfType(json, r'withdrawal_fee'), + depositFee: mapValueOfType(json, r'deposit_fee'), + minWithdrawal: mapValueOfType(json, r'min_withdrawal'), + type: mapValueOfType(json, r'type'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Blockchain.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Blockchain.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Blockchain-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Blockchain.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/coin.dart b/lib/model/coin.dart new file mode 100644 index 0000000..05f2c86 --- /dev/null +++ b/lib/model/coin.dart @@ -0,0 +1,153 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Coin { + /// Returns a new [Coin] instance. + Coin({ + this.coinCode, + this.coinName, + this.status, + this.blockchains = const [], + }); + /// The unique code for the coin. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinCode; + + /// The name of the coin. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinName; + + /// Status of the coin. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + List blockchains; + + @override + bool operator ==(Object other) => identical(this, other) || other is Coin && + other.coinCode == coinCode && + other.coinName == coinName && + other.status == status && + _deepEquality.equals(other.blockchains, blockchains); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (coinCode == null ? 0 : coinCode!.hashCode) + + (coinName == null ? 0 : coinName!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (blockchains.hashCode); + + @override + String toString() => 'Coin[coinCode=$coinCode, coinName=$coinName, status=$status, blockchains=$blockchains]'; + + Map toJson() { + final json = {}; + if (this.coinCode != null) { + json[r'coin_code'] = this.coinCode; + } + if (this.coinName != null) { + json[r'coin_name'] = this.coinName; + } + if (this.status != null) { + json[r'status'] = this.status; + } + json[r'blockchains'] = this.blockchains; + return json; + } + + /// Returns a new [Coin] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Coin? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Coin[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Coin[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Coin( + coinCode: mapValueOfType(json, r'coin_code'), + coinName: mapValueOfType(json, r'coin_name'), + status: mapValueOfType(json, r'status'), + blockchains: Blockchain.listFromJson(json[r'blockchains']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Coin.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Coin.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Coin-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Coin.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/confirm_sell_order_data.dart b/lib/model/confirm_sell_order_data.dart new file mode 100644 index 0000000..83ed3c4 --- /dev/null +++ b/lib/model/confirm_sell_order_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ConfirmSellOrderData { + /// Returns a new [ConfirmSellOrderData] instance. + ConfirmSellOrderData({ + this.order, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Order? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is ConfirmSellOrderData && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'ConfirmSellOrderData[order=$order]'; + + Map toJson() { + final json = {}; + if (this.order != null) { + json[r'order'] = this.order; + } + return json; + } + + /// Returns a new [ConfirmSellOrderData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ConfirmSellOrderData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ConfirmSellOrderData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ConfirmSellOrderData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ConfirmSellOrderData( + order: Order.fromJson(json[r'order']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ConfirmSellOrderData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ConfirmSellOrderData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ConfirmSellOrderData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ConfirmSellOrderData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/confirm_sell_order_request.dart b/lib/model/confirm_sell_order_request.dart new file mode 100644 index 0000000..352f554 --- /dev/null +++ b/lib/model/confirm_sell_order_request.dart @@ -0,0 +1,137 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ConfirmSellOrderRequest { + /// Returns a new [ConfirmSellOrderRequest] instance. + ConfirmSellOrderRequest({ + required this.transactionHash, + required this.source_, + required this.sourceAddress, + this.sourceAddressTag, + }); + /// The transaction hash (ID) of the crypto deposit made by the user. + String transactionHash; + + /// Source of the transaction information (e.g., BLOCKCHAIN_EXPLORER, USER_INPUT). + String source_; + + /// The user's wallet address from which the crypto was sent. + String sourceAddress; + + /// Tag or memo for the source wallet address, if applicable. + String? sourceAddressTag; + + @override + bool operator ==(Object other) => identical(this, other) || other is ConfirmSellOrderRequest && + other.transactionHash == transactionHash && + other.source_ == source_ && + other.sourceAddress == sourceAddress && + other.sourceAddressTag == sourceAddressTag; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (transactionHash.hashCode) + + (source_.hashCode) + + (sourceAddress.hashCode) + + (sourceAddressTag == null ? 0 : sourceAddressTag!.hashCode); + + @override + String toString() => 'ConfirmSellOrderRequest[transactionHash=$transactionHash, source_=$source_, sourceAddress=$sourceAddress, sourceAddressTag=$sourceAddressTag]'; + + Map toJson() { + final json = {}; + json[r'transaction_hash'] = this.transactionHash; + json[r'source'] = this.source_; + json[r'source_address'] = this.sourceAddress; + if (this.sourceAddressTag != null) { + json[r'source_address_tag'] = this.sourceAddressTag; + } else { + json[r'source_address_tag'] = null; + } + return json; + } + + /// Returns a new [ConfirmSellOrderRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ConfirmSellOrderRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ConfirmSellOrderRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ConfirmSellOrderRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ConfirmSellOrderRequest( + transactionHash: mapValueOfType(json, r'transaction_hash')!, + source_: mapValueOfType(json, r'source')!, + sourceAddress: mapValueOfType(json, r'source_address')!, + sourceAddressTag: mapValueOfType(json, r'source_address_tag'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ConfirmSellOrderRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ConfirmSellOrderRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ConfirmSellOrderRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ConfirmSellOrderRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'transaction_hash', + 'source', + 'source_address', + }; +} diff --git a/lib/model/confirm_sell_order_response.dart b/lib/model/confirm_sell_order_response.dart new file mode 100644 index 0000000..e13e417 --- /dev/null +++ b/lib/model/confirm_sell_order_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class ConfirmSellOrderResponse { + /// Returns a new [ConfirmSellOrderResponse] instance. + ConfirmSellOrderResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + ConfirmSellOrderData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is ConfirmSellOrderResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'ConfirmSellOrderResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [ConfirmSellOrderResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ConfirmSellOrderResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "ConfirmSellOrderResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "ConfirmSellOrderResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ConfirmSellOrderResponse( + data: ConfirmSellOrderData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ConfirmSellOrderResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ConfirmSellOrderResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of ConfirmSellOrderResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ConfirmSellOrderResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/country.dart b/lib/model/country.dart new file mode 100644 index 0000000..0fb3a64 --- /dev/null +++ b/lib/model/country.dart @@ -0,0 +1,170 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Country { + /// Returns a new [Country] instance. + Country({ + this.countryCode, + this.countryName, + this.status, + this.isStateRequired, + this.supportedDocuments = const [], + }); + /// ISO 3166-1 alpha-2 country code. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? countryCode; + + /// Name of the country. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? countryName; + + /// Status. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + bool? isStateRequired; + + List? supportedDocuments; + + @override + bool operator ==(Object other) => identical(this, other) || other is Country && + other.countryCode == countryCode && + other.countryName == countryName && + other.status == status && + other.isStateRequired == isStateRequired && + _deepEquality.equals(other.supportedDocuments, supportedDocuments); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (countryCode == null ? 0 : countryCode!.hashCode) + + (countryName == null ? 0 : countryName!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (isStateRequired == null ? 0 : isStateRequired!.hashCode) + + (supportedDocuments == null ? 0 : supportedDocuments!.hashCode); + + @override + String toString() => 'Country[countryCode=$countryCode, countryName=$countryName, status=$status, isStateRequired=$isStateRequired, supportedDocuments=$supportedDocuments]'; + + Map toJson() { + final json = {}; + if (this.countryCode != null) { + json[r'country_code'] = this.countryCode; + } + if (this.countryName != null) { + json[r'country_name'] = this.countryName; + } + if (this.status != null) { + json[r'status'] = this.status; + } + if (this.isStateRequired != null) { + json[r'is_state_required'] = this.isStateRequired; + } else { + json[r'is_state_required'] = null; + } + if (this.supportedDocuments != null) { + json[r'supported_documents'] = this.supportedDocuments; + } else { + json[r'supported_documents'] = null; + } + return json; + } + + /// Returns a new [Country] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Country? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Country[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Country[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Country( + countryCode: mapValueOfType(json, r'country_code'), + countryName: mapValueOfType(json, r'country_name'), + status: mapValueOfType(json, r'status'), + isStateRequired: mapValueOfType(json, r'is_state_required'), + supportedDocuments: json[r'supported_documents'] is Iterable + ? (json[r'supported_documents'] as Iterable).cast().toList(growable: false) + : const [], + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Country.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Country.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Country-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Country.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_kyc_account_data.dart b/lib/model/create_kyc_account_data.dart new file mode 100644 index 0000000..07c4777 --- /dev/null +++ b/lib/model/create_kyc_account_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateKycAccountData { + /// Returns a new [CreateKycAccountData] instance. + CreateKycAccountData({ + this.kycAccount, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + KycAccount? kycAccount; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateKycAccountData && + other.kycAccount == kycAccount; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (kycAccount == null ? 0 : kycAccount!.hashCode); + + @override + String toString() => 'CreateKycAccountData[kycAccount=$kycAccount]'; + + Map toJson() { + final json = {}; + if (this.kycAccount != null) { + json[r'kyc_account'] = this.kycAccount; + } + return json; + } + + /// Returns a new [CreateKycAccountData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateKycAccountData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateKycAccountData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateKycAccountData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateKycAccountData( + kycAccount: KycAccount.fromJson(json[r'kyc_account']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateKycAccountData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateKycAccountData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateKycAccountData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateKycAccountData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_kyc_account_request.dart b/lib/model/create_kyc_account_request.dart new file mode 100644 index 0000000..5af8c5b --- /dev/null +++ b/lib/model/create_kyc_account_request.dart @@ -0,0 +1,215 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateKycAccountRequest { + /// Returns a new [CreateKycAccountRequest] instance. + CreateKycAccountRequest({ + required this.accountReference, + required this.givenName, + this.middleName, + required this.surname, + required this.dob, + required this.email, + required this.mobileNumber, + required this.residentialAddress, + required this.documentType, + this.documentIdNumber, + required this.documentCountryOfIssue, + this.documentImages = const [], + this.metaData = const {}, + }); + String accountReference; + + String givenName; + + String? middleName; + + String surname; + + DateTime dob; + + String email; + + String mobileNumber; + + Address residentialAddress; + + String documentType; + + String? documentIdNumber; + + String documentCountryOfIssue; + + List? documentImages; + + /// Arbitrary key-value pairs for additional metadata. + Map? metaData; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateKycAccountRequest && + other.accountReference == accountReference && + other.givenName == givenName && + other.middleName == middleName && + other.surname == surname && + other.dob == dob && + other.email == email && + other.mobileNumber == mobileNumber && + other.residentialAddress == residentialAddress && + other.documentType == documentType && + other.documentIdNumber == documentIdNumber && + other.documentCountryOfIssue == documentCountryOfIssue && + _deepEquality.equals(other.documentImages, documentImages) && + _deepEquality.equals(other.metaData, metaData); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (accountReference.hashCode) + + (givenName.hashCode) + + (middleName == null ? 0 : middleName!.hashCode) + + (surname.hashCode) + + (dob.hashCode) + + (email.hashCode) + + (mobileNumber.hashCode) + + (residentialAddress.hashCode) + + (documentType.hashCode) + + (documentIdNumber == null ? 0 : documentIdNumber!.hashCode) + + (documentCountryOfIssue.hashCode) + + (documentImages == null ? 0 : documentImages!.hashCode) + + (metaData == null ? 0 : metaData!.hashCode); + + @override + String toString() => 'CreateKycAccountRequest[accountReference=$accountReference, givenName=$givenName, middleName=$middleName, surname=$surname, dob=$dob, email=$email, mobileNumber=$mobileNumber, residentialAddress=$residentialAddress, documentType=$documentType, documentIdNumber=$documentIdNumber, documentCountryOfIssue=$documentCountryOfIssue, documentImages=$documentImages, metaData=$metaData]'; + + Map toJson() { + final json = {}; + json[r'account_reference'] = this.accountReference; + json[r'given_name'] = this.givenName; + if (this.middleName != null) { + json[r'middle_name'] = this.middleName; + } else { + json[r'middle_name'] = null; + } + json[r'surname'] = this.surname; + json[r'dob'] = _dateFormatter.format(this.dob.toUtc()); + json[r'email'] = this.email; + json[r'mobile_number'] = this.mobileNumber; + json[r'residential_address'] = this.residentialAddress; + json[r'document_type'] = this.documentType; + if (this.documentIdNumber != null) { + json[r'document_id_number'] = this.documentIdNumber; + } else { + json[r'document_id_number'] = null; + } + json[r'document_country_of_issue'] = this.documentCountryOfIssue; + if (this.documentImages != null) { + json[r'document_images'] = this.documentImages; + } else { + json[r'document_images'] = null; + } + if (this.metaData != null) { + json[r'meta_data'] = this.metaData; + } else { + json[r'meta_data'] = null; + } + return json; + } + + /// Returns a new [CreateKycAccountRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateKycAccountRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateKycAccountRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateKycAccountRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateKycAccountRequest( + accountReference: mapValueOfType(json, r'account_reference')!, + givenName: mapValueOfType(json, r'given_name')!, + middleName: mapValueOfType(json, r'middle_name'), + surname: mapValueOfType(json, r'surname')!, + dob: mapDateTime(json, r'dob', r'')!, + email: mapValueOfType(json, r'email')!, + mobileNumber: mapValueOfType(json, r'mobile_number')!, + residentialAddress: Address.fromJson(json[r'residential_address'])!, + documentType: mapValueOfType(json, r'document_type')!, + documentIdNumber: mapValueOfType(json, r'document_id_number'), + documentCountryOfIssue: mapValueOfType(json, r'document_country_of_issue')!, + documentImages: KycDocumentImage.listFromJson(json[r'document_images']), + metaData: mapCastOfType(json, r'meta_data') ?? const {}, + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateKycAccountRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateKycAccountRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateKycAccountRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateKycAccountRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'account_reference', + 'given_name', + 'surname', + 'dob', + 'email', + 'mobile_number', + 'residential_address', + 'document_type', + 'document_country_of_issue', + }; +} diff --git a/lib/model/create_kyc_account_response.dart b/lib/model/create_kyc_account_response.dart new file mode 100644 index 0000000..ad29809 --- /dev/null +++ b/lib/model/create_kyc_account_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateKycAccountResponse { + /// Returns a new [CreateKycAccountResponse] instance. + CreateKycAccountResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + CreateKycAccountData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateKycAccountResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'CreateKycAccountResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [CreateKycAccountResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateKycAccountResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateKycAccountResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateKycAccountResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateKycAccountResponse( + data: CreateKycAccountData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateKycAccountResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateKycAccountResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateKycAccountResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateKycAccountResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_nft_order_data.dart b/lib/model/create_nft_order_data.dart new file mode 100644 index 0000000..0af380e --- /dev/null +++ b/lib/model/create_nft_order_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateNftOrderData { + /// Returns a new [CreateNftOrderData] instance. + CreateNftOrderData({ + this.order, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Order? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateNftOrderData && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'CreateNftOrderData[order=$order]'; + + Map toJson() { + final json = {}; + if (this.order != null) { + json[r'order'] = this.order; + } + return json; + } + + /// Returns a new [CreateNftOrderData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateNftOrderData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateNftOrderData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateNftOrderData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateNftOrderData( + order: Order.fromJson(json[r'order']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateNftOrderData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateNftOrderData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateNftOrderData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateNftOrderData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_nft_order_request.dart b/lib/model/create_nft_order_request.dart new file mode 100644 index 0000000..b80b1db --- /dev/null +++ b/lib/model/create_nft_order_request.dart @@ -0,0 +1,188 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateNftOrderRequest { + /// Returns a new [CreateNftOrderRequest] instance. + CreateNftOrderRequest({ + required this.accountReference, + required this.targetWalletAddress, + required this.targetBlockchain, + required this.paymentMethodId, + this.nfts = const [], + required this.returnUrlOnSuccess, + required this.returnUrlOnFailure, + this.returnUrlOnPending, + this.iframeReferralDomain, + this.metaData = const {}, + }); + String accountReference; + + String targetWalletAddress; + + String targetBlockchain; + + int paymentMethodId; + + List nfts; + + String returnUrlOnSuccess; + + String returnUrlOnFailure; + + String? returnUrlOnPending; + + String? iframeReferralDomain; + + /// Arbitrary key-value pairs for additional metadata. + Map? metaData; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateNftOrderRequest && + other.accountReference == accountReference && + other.targetWalletAddress == targetWalletAddress && + other.targetBlockchain == targetBlockchain && + other.paymentMethodId == paymentMethodId && + _deepEquality.equals(other.nfts, nfts) && + other.returnUrlOnSuccess == returnUrlOnSuccess && + other.returnUrlOnFailure == returnUrlOnFailure && + other.returnUrlOnPending == returnUrlOnPending && + other.iframeReferralDomain == iframeReferralDomain && + _deepEquality.equals(other.metaData, metaData); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (accountReference.hashCode) + + (targetWalletAddress.hashCode) + + (targetBlockchain.hashCode) + + (paymentMethodId.hashCode) + + (nfts.hashCode) + + (returnUrlOnSuccess.hashCode) + + (returnUrlOnFailure.hashCode) + + (returnUrlOnPending == null ? 0 : returnUrlOnPending!.hashCode) + + (iframeReferralDomain == null ? 0 : iframeReferralDomain!.hashCode) + + (metaData == null ? 0 : metaData!.hashCode); + + @override + String toString() => 'CreateNftOrderRequest[accountReference=$accountReference, targetWalletAddress=$targetWalletAddress, targetBlockchain=$targetBlockchain, paymentMethodId=$paymentMethodId, nfts=$nfts, returnUrlOnSuccess=$returnUrlOnSuccess, returnUrlOnFailure=$returnUrlOnFailure, returnUrlOnPending=$returnUrlOnPending, iframeReferralDomain=$iframeReferralDomain, metaData=$metaData]'; + + Map toJson() { + final json = {}; + json[r'account_reference'] = this.accountReference; + json[r'target_wallet_address'] = this.targetWalletAddress; + json[r'target_blockchain'] = this.targetBlockchain; + json[r'payment_method_id'] = this.paymentMethodId; + json[r'nfts'] = this.nfts; + json[r'return_url_on_success'] = this.returnUrlOnSuccess; + json[r'return_url_on_failure'] = this.returnUrlOnFailure; + if (this.returnUrlOnPending != null) { + json[r'return_url_on_pending'] = this.returnUrlOnPending; + } else { + json[r'return_url_on_pending'] = null; + } + if (this.iframeReferralDomain != null) { + json[r'iframe_referral_domain'] = this.iframeReferralDomain; + } else { + json[r'iframe_referral_domain'] = null; + } + if (this.metaData != null) { + json[r'meta_data'] = this.metaData; + } else { + json[r'meta_data'] = null; + } + return json; + } + + /// Returns a new [CreateNftOrderRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateNftOrderRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateNftOrderRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateNftOrderRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateNftOrderRequest( + accountReference: mapValueOfType(json, r'account_reference')!, + targetWalletAddress: mapValueOfType(json, r'target_wallet_address')!, + targetBlockchain: mapValueOfType(json, r'target_blockchain')!, + paymentMethodId: mapValueOfType(json, r'payment_method_id')!, + nfts: NftCheckoutData.listFromJson(json[r'nfts']), + returnUrlOnSuccess: mapValueOfType(json, r'return_url_on_success')!, + returnUrlOnFailure: mapValueOfType(json, r'return_url_on_failure')!, + returnUrlOnPending: mapValueOfType(json, r'return_url_on_pending'), + iframeReferralDomain: mapValueOfType(json, r'iframe_referral_domain'), + metaData: mapCastOfType(json, r'meta_data') ?? const {}, + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateNftOrderRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateNftOrderRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateNftOrderRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateNftOrderRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'account_reference', + 'target_wallet_address', + 'target_blockchain', + 'payment_method_id', + 'nfts', + 'return_url_on_success', + 'return_url_on_failure', + }; +} diff --git a/lib/model/create_nft_order_response.dart b/lib/model/create_nft_order_response.dart new file mode 100644 index 0000000..7fa5195 --- /dev/null +++ b/lib/model/create_nft_order_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateNftOrderResponse { + /// Returns a new [CreateNftOrderResponse] instance. + CreateNftOrderResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + CreateNftOrderData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateNftOrderResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'CreateNftOrderResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [CreateNftOrderResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateNftOrderResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateNftOrderResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateNftOrderResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateNftOrderResponse( + data: CreateNftOrderData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateNftOrderResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateNftOrderResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateNftOrderResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateNftOrderResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_order_data.dart b/lib/model/create_order_data.dart new file mode 100644 index 0000000..860e03a --- /dev/null +++ b/lib/model/create_order_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateOrderData { + /// Returns a new [CreateOrderData] instance. + CreateOrderData({ + this.order, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Order? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateOrderData && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'CreateOrderData[order=$order]'; + + Map toJson() { + final json = {}; + if (this.order != null) { + json[r'order'] = this.order; + } + return json; + } + + /// Returns a new [CreateOrderData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateOrderData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateOrderData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateOrderData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateOrderData( + order: Order.fromJson(json[r'order']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateOrderData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateOrderData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateOrderData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateOrderData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_order_request.dart b/lib/model/create_order_request.dart new file mode 100644 index 0000000..5ffdf69 --- /dev/null +++ b/lib/model/create_order_request.dart @@ -0,0 +1,248 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateOrderRequest { + /// Returns a new [CreateOrderRequest] instance. + CreateOrderRequest({ + required this.accountReference, + required this.fiatCurrency, + required this.coinCurrency, + this.coinAmount, + this.fiatAmount, + required this.paymentMethodId, + this.walletAddress, + this.walletAddressTag, + required this.returnUrlOnSuccess, + required this.returnUrlOnFailure, + this.returnUrlOnPending, + this.iframeReferralDomain, + this.blockchain, + this.quoteId, + }); + /// Your internal reference for the user/account. + String accountReference; + + /// Fiat currency code for the order. For BUY, this is source. For SELL, this is target. + String fiatCurrency; + + /// Coin currency code for the order. For BUY, this is target. For SELL, this is source. + String coinCurrency; + + /// Amount of coin to buy/sell. Provide either this or fiat_amount. + String? coinAmount; + + /// Amount of fiat to spend/receive. Provide either this or coin_amount. + String? fiatAmount; + + /// ID of the chosen payment method. + int paymentMethodId; + + /// User's crypto wallet address (for BUY orders). + String? walletAddress; + + /// Tag or memo for certain wallet addresses (e.g., XRP, XLM). + String? walletAddressTag; + + /// URL to redirect the user to on successful payment/order. + String returnUrlOnSuccess; + + /// URL to redirect the user to on failed payment/order. + String returnUrlOnFailure; + + /// URL to redirect the user to if payment is pending. + String? returnUrlOnPending; + + /// If using Banxa checkout in an iframe, your domain. + String? iframeReferralDomain; + + /// Specify blockchain for the coin if applicable. + String? blockchain; + + /// Optional ID of a previously created quote to use for this order. + String? quoteId; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateOrderRequest && + other.accountReference == accountReference && + other.fiatCurrency == fiatCurrency && + other.coinCurrency == coinCurrency && + other.coinAmount == coinAmount && + other.fiatAmount == fiatAmount && + other.paymentMethodId == paymentMethodId && + other.walletAddress == walletAddress && + other.walletAddressTag == walletAddressTag && + other.returnUrlOnSuccess == returnUrlOnSuccess && + other.returnUrlOnFailure == returnUrlOnFailure && + other.returnUrlOnPending == returnUrlOnPending && + other.iframeReferralDomain == iframeReferralDomain && + other.blockchain == blockchain && + other.quoteId == quoteId; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (accountReference.hashCode) + + (fiatCurrency.hashCode) + + (coinCurrency.hashCode) + + (coinAmount == null ? 0 : coinAmount!.hashCode) + + (fiatAmount == null ? 0 : fiatAmount!.hashCode) + + (paymentMethodId.hashCode) + + (walletAddress == null ? 0 : walletAddress!.hashCode) + + (walletAddressTag == null ? 0 : walletAddressTag!.hashCode) + + (returnUrlOnSuccess.hashCode) + + (returnUrlOnFailure.hashCode) + + (returnUrlOnPending == null ? 0 : returnUrlOnPending!.hashCode) + + (iframeReferralDomain == null ? 0 : iframeReferralDomain!.hashCode) + + (blockchain == null ? 0 : blockchain!.hashCode) + + (quoteId == null ? 0 : quoteId!.hashCode); + + @override + String toString() => 'CreateOrderRequest[accountReference=$accountReference, fiatCurrency=$fiatCurrency, coinCurrency=$coinCurrency, coinAmount=$coinAmount, fiatAmount=$fiatAmount, paymentMethodId=$paymentMethodId, walletAddress=$walletAddress, walletAddressTag=$walletAddressTag, returnUrlOnSuccess=$returnUrlOnSuccess, returnUrlOnFailure=$returnUrlOnFailure, returnUrlOnPending=$returnUrlOnPending, iframeReferralDomain=$iframeReferralDomain, blockchain=$blockchain, quoteId=$quoteId]'; + + Map toJson() { + final json = {}; + json[r'account_reference'] = this.accountReference; + json[r'fiat_currency'] = this.fiatCurrency; + json[r'coin_currency'] = this.coinCurrency; + if (this.coinAmount != null) { + json[r'coin_amount'] = this.coinAmount; + } else { + json[r'coin_amount'] = null; + } + if (this.fiatAmount != null) { + json[r'fiat_amount'] = this.fiatAmount; + } else { + json[r'fiat_amount'] = null; + } + json[r'payment_method_id'] = this.paymentMethodId; + if (this.walletAddress != null) { + json[r'wallet_address'] = this.walletAddress; + } else { + json[r'wallet_address'] = null; + } + if (this.walletAddressTag != null) { + json[r'wallet_address_tag'] = this.walletAddressTag; + } else { + json[r'wallet_address_tag'] = null; + } + json[r'return_url_on_success'] = this.returnUrlOnSuccess; + json[r'return_url_on_failure'] = this.returnUrlOnFailure; + if (this.returnUrlOnPending != null) { + json[r'return_url_on_pending'] = this.returnUrlOnPending; + } else { + json[r'return_url_on_pending'] = null; + } + if (this.iframeReferralDomain != null) { + json[r'iframe_referral_domain'] = this.iframeReferralDomain; + } else { + json[r'iframe_referral_domain'] = null; + } + if (this.blockchain != null) { + json[r'blockchain'] = this.blockchain; + } else { + json[r'blockchain'] = null; + } + if (this.quoteId != null) { + json[r'quote_id'] = this.quoteId; + } else { + json[r'quote_id'] = null; + } + return json; + } + + /// Returns a new [CreateOrderRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateOrderRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateOrderRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateOrderRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateOrderRequest( + accountReference: mapValueOfType(json, r'account_reference')!, + fiatCurrency: mapValueOfType(json, r'fiat_currency')!, + coinCurrency: mapValueOfType(json, r'coin_currency')!, + coinAmount: mapValueOfType(json, r'coin_amount'), + fiatAmount: mapValueOfType(json, r'fiat_amount'), + paymentMethodId: mapValueOfType(json, r'payment_method_id')!, + walletAddress: mapValueOfType(json, r'wallet_address'), + walletAddressTag: mapValueOfType(json, r'wallet_address_tag'), + returnUrlOnSuccess: mapValueOfType(json, r'return_url_on_success')!, + returnUrlOnFailure: mapValueOfType(json, r'return_url_on_failure')!, + returnUrlOnPending: mapValueOfType(json, r'return_url_on_pending'), + iframeReferralDomain: mapValueOfType(json, r'iframe_referral_domain'), + blockchain: mapValueOfType(json, r'blockchain'), + quoteId: mapValueOfType(json, r'quote_id'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateOrderRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateOrderRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateOrderRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateOrderRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'account_reference', + 'fiat_currency', + 'coin_currency', + 'payment_method_id', + 'return_url_on_success', + 'return_url_on_failure', + }; +} diff --git a/lib/model/create_order_response.dart b/lib/model/create_order_response.dart new file mode 100644 index 0000000..669d4fa --- /dev/null +++ b/lib/model/create_order_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateOrderResponse { + /// Returns a new [CreateOrderResponse] instance. + CreateOrderResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + CreateOrderData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateOrderResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'CreateOrderResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [CreateOrderResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateOrderResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateOrderResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateOrderResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateOrderResponse( + data: CreateOrderData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateOrderResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateOrderResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateOrderResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateOrderResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_quote_data.dart b/lib/model/create_quote_data.dart new file mode 100644 index 0000000..061694f --- /dev/null +++ b/lib/model/create_quote_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateQuoteData { + /// Returns a new [CreateQuoteData] instance. + CreateQuoteData({ + this.quote, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Quote? quote; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateQuoteData && + other.quote == quote; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (quote == null ? 0 : quote!.hashCode); + + @override + String toString() => 'CreateQuoteData[quote=$quote]'; + + Map toJson() { + final json = {}; + if (this.quote != null) { + json[r'quote'] = this.quote; + } + return json; + } + + /// Returns a new [CreateQuoteData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateQuoteData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateQuoteData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateQuoteData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateQuoteData( + quote: Quote.fromJson(json[r'quote']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateQuoteData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateQuoteData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateQuoteData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateQuoteData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/create_quote_request.dart b/lib/model/create_quote_request.dart new file mode 100644 index 0000000..498fa8e --- /dev/null +++ b/lib/model/create_quote_request.dart @@ -0,0 +1,173 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateQuoteRequest { + /// Returns a new [CreateQuoteRequest] instance. + CreateQuoteRequest({ + required this.sourceCurrency, + required this.targetCurrency, + this.sourceAmount, + this.targetAmount, + required this.accountReference, + this.paymentMethodId, + this.blockchain, + }); + /// The currency code to convert from (e.g., USD, BTC). + String sourceCurrency; + + /// The currency code to convert to (e.g., BTC, USD). + String targetCurrency; + + /// Amount of source currency. Either source_amount or target_amount is required. + String? sourceAmount; + + /// Amount of target currency. Either source_amount or target_amount is required. + String? targetAmount; + + /// Your internal reference for the user/account. + String accountReference; + + /// Optional payment method ID to get a quote specific to it. + int? paymentMethodId; + + /// Specify blockchain for the target crypto if applicable. + String? blockchain; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateQuoteRequest && + other.sourceCurrency == sourceCurrency && + other.targetCurrency == targetCurrency && + other.sourceAmount == sourceAmount && + other.targetAmount == targetAmount && + other.accountReference == accountReference && + other.paymentMethodId == paymentMethodId && + other.blockchain == blockchain; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (sourceCurrency.hashCode) + + (targetCurrency.hashCode) + + (sourceAmount == null ? 0 : sourceAmount!.hashCode) + + (targetAmount == null ? 0 : targetAmount!.hashCode) + + (accountReference.hashCode) + + (paymentMethodId == null ? 0 : paymentMethodId!.hashCode) + + (blockchain == null ? 0 : blockchain!.hashCode); + + @override + String toString() => 'CreateQuoteRequest[sourceCurrency=$sourceCurrency, targetCurrency=$targetCurrency, sourceAmount=$sourceAmount, targetAmount=$targetAmount, accountReference=$accountReference, paymentMethodId=$paymentMethodId, blockchain=$blockchain]'; + + Map toJson() { + final json = {}; + json[r'source_currency'] = this.sourceCurrency; + json[r'target_currency'] = this.targetCurrency; + if (this.sourceAmount != null) { + json[r'source_amount'] = this.sourceAmount; + } else { + json[r'source_amount'] = null; + } + if (this.targetAmount != null) { + json[r'target_amount'] = this.targetAmount; + } else { + json[r'target_amount'] = null; + } + json[r'account_reference'] = this.accountReference; + if (this.paymentMethodId != null) { + json[r'payment_method_id'] = this.paymentMethodId; + } else { + json[r'payment_method_id'] = null; + } + if (this.blockchain != null) { + json[r'blockchain'] = this.blockchain; + } else { + json[r'blockchain'] = null; + } + return json; + } + + /// Returns a new [CreateQuoteRequest] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateQuoteRequest? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateQuoteRequest[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateQuoteRequest[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateQuoteRequest( + sourceCurrency: mapValueOfType(json, r'source_currency')!, + targetCurrency: mapValueOfType(json, r'target_currency')!, + sourceAmount: mapValueOfType(json, r'source_amount'), + targetAmount: mapValueOfType(json, r'target_amount'), + accountReference: mapValueOfType(json, r'account_reference')!, + paymentMethodId: mapValueOfType(json, r'payment_method_id'), + blockchain: mapValueOfType(json, r'blockchain'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateQuoteRequest.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateQuoteRequest.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateQuoteRequest-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateQuoteRequest.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'source_currency', + 'target_currency', + 'account_reference', + }; +} diff --git a/lib/model/create_quote_response.dart b/lib/model/create_quote_response.dart new file mode 100644 index 0000000..45c1197 --- /dev/null +++ b/lib/model/create_quote_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class CreateQuoteResponse { + /// Returns a new [CreateQuoteResponse] instance. + CreateQuoteResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + CreateQuoteData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is CreateQuoteResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'CreateQuoteResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [CreateQuoteResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static CreateQuoteResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "CreateQuoteResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "CreateQuoteResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return CreateQuoteResponse( + data: CreateQuoteData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = CreateQuoteResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = CreateQuoteResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of CreateQuoteResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = CreateQuoteResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/fiat.dart b/lib/model/fiat.dart new file mode 100644 index 0000000..d2f9c8e --- /dev/null +++ b/lib/model/fiat.dart @@ -0,0 +1,162 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Fiat { + /// Returns a new [Fiat] instance. + Fiat({ + this.fiatCode, + this.fiatName, + this.fiatSymbol, + this.status, + }); + /// The unique code for the fiat currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatCode; + + /// The name of the fiat currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatName; + + /// The symbol for the fiat currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatSymbol; + + /// Status of the fiat currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + @override + bool operator ==(Object other) => identical(this, other) || other is Fiat && + other.fiatCode == fiatCode && + other.fiatName == fiatName && + other.fiatSymbol == fiatSymbol && + other.status == status; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (fiatCode == null ? 0 : fiatCode!.hashCode) + + (fiatName == null ? 0 : fiatName!.hashCode) + + (fiatSymbol == null ? 0 : fiatSymbol!.hashCode) + + (status == null ? 0 : status!.hashCode); + + @override + String toString() => 'Fiat[fiatCode=$fiatCode, fiatName=$fiatName, fiatSymbol=$fiatSymbol, status=$status]'; + + Map toJson() { + final json = {}; + if (this.fiatCode != null) { + json[r'fiat_code'] = this.fiatCode; + } + if (this.fiatName != null) { + json[r'fiat_name'] = this.fiatName; + } + if (this.fiatSymbol != null) { + json[r'fiat_symbol'] = this.fiatSymbol; + } + if (this.status != null) { + json[r'status'] = this.status; + } + return json; + } + + /// Returns a new [Fiat] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Fiat? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Fiat[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Fiat[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Fiat( + fiatCode: mapValueOfType(json, r'fiat_code'), + fiatName: mapValueOfType(json, r'fiat_name'), + fiatSymbol: mapValueOfType(json, r'fiat_symbol'), + status: mapValueOfType(json, r'status'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Fiat.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Fiat.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Fiat-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Fiat.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_coins_data.dart b/lib/model/get_coins_data.dart new file mode 100644 index 0000000..7837a9c --- /dev/null +++ b/lib/model/get_coins_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetCoinsData { + /// Returns a new [GetCoinsData] instance. + GetCoinsData({ + this.coins = const [], + }); + List coins; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetCoinsData && + _deepEquality.equals(other.coins, coins); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (coins.hashCode); + + @override + String toString() => 'GetCoinsData[coins=$coins]'; + + Map toJson() { + final json = {}; + json[r'coins'] = this.coins; + return json; + } + + /// Returns a new [GetCoinsData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetCoinsData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetCoinsData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetCoinsData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetCoinsData( + coins: Coin.listFromJson(json[r'coins']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetCoinsData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetCoinsData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetCoinsData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetCoinsData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_coins_response.dart b/lib/model/get_coins_response.dart new file mode 100644 index 0000000..45aea19 --- /dev/null +++ b/lib/model/get_coins_response.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetCoinsResponse { + /// Returns a new [GetCoinsResponse] instance. + GetCoinsResponse({ + this.pagination, + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Pagination? pagination; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetCoinsData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetCoinsResponse && + other.pagination == pagination && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pagination == null ? 0 : pagination!.hashCode) + + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetCoinsResponse[pagination=$pagination, data=$data]'; + + Map toJson() { + final json = {}; + if (this.pagination != null) { + json[r'pagination'] = this.pagination; + } + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetCoinsResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetCoinsResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetCoinsResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetCoinsResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetCoinsResponse( + pagination: Pagination.fromJson(json[r'pagination']), + data: GetCoinsData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetCoinsResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetCoinsResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetCoinsResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetCoinsResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_countries_data.dart b/lib/model/get_countries_data.dart new file mode 100644 index 0000000..591b02c --- /dev/null +++ b/lib/model/get_countries_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetCountriesData { + /// Returns a new [GetCountriesData] instance. + GetCountriesData({ + this.countries = const [], + }); + List countries; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetCountriesData && + _deepEquality.equals(other.countries, countries); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (countries.hashCode); + + @override + String toString() => 'GetCountriesData[countries=$countries]'; + + Map toJson() { + final json = {}; + json[r'countries'] = this.countries; + return json; + } + + /// Returns a new [GetCountriesData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetCountriesData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetCountriesData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetCountriesData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetCountriesData( + countries: Country.listFromJson(json[r'countries']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetCountriesData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetCountriesData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetCountriesData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetCountriesData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_countries_response.dart b/lib/model/get_countries_response.dart new file mode 100644 index 0000000..eacd927 --- /dev/null +++ b/lib/model/get_countries_response.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetCountriesResponse { + /// Returns a new [GetCountriesResponse] instance. + GetCountriesResponse({ + this.pagination, + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Pagination? pagination; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetCountriesData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetCountriesResponse && + other.pagination == pagination && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pagination == null ? 0 : pagination!.hashCode) + + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetCountriesResponse[pagination=$pagination, data=$data]'; + + Map toJson() { + final json = {}; + if (this.pagination != null) { + json[r'pagination'] = this.pagination; + } + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetCountriesResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetCountriesResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetCountriesResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetCountriesResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetCountriesResponse( + pagination: Pagination.fromJson(json[r'pagination']), + data: GetCountriesData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetCountriesResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetCountriesResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetCountriesResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetCountriesResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_fiats_data.dart b/lib/model/get_fiats_data.dart new file mode 100644 index 0000000..8ba83b2 --- /dev/null +++ b/lib/model/get_fiats_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetFiatsData { + /// Returns a new [GetFiatsData] instance. + GetFiatsData({ + this.fiats = const [], + }); + List fiats; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetFiatsData && + _deepEquality.equals(other.fiats, fiats); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (fiats.hashCode); + + @override + String toString() => 'GetFiatsData[fiats=$fiats]'; + + Map toJson() { + final json = {}; + json[r'fiats'] = this.fiats; + return json; + } + + /// Returns a new [GetFiatsData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetFiatsData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetFiatsData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetFiatsData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetFiatsData( + fiats: Fiat.listFromJson(json[r'fiats']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetFiatsData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetFiatsData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetFiatsData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetFiatsData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_fiats_response.dart b/lib/model/get_fiats_response.dart new file mode 100644 index 0000000..92bf101 --- /dev/null +++ b/lib/model/get_fiats_response.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetFiatsResponse { + /// Returns a new [GetFiatsResponse] instance. + GetFiatsResponse({ + this.pagination, + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Pagination? pagination; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetFiatsData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetFiatsResponse && + other.pagination == pagination && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pagination == null ? 0 : pagination!.hashCode) + + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetFiatsResponse[pagination=$pagination, data=$data]'; + + Map toJson() { + final json = {}; + if (this.pagination != null) { + json[r'pagination'] = this.pagination; + } + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetFiatsResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetFiatsResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetFiatsResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetFiatsResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetFiatsResponse( + pagination: Pagination.fromJson(json[r'pagination']), + data: GetFiatsData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetFiatsResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetFiatsResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetFiatsResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetFiatsResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_kyc_account_data.dart b/lib/model/get_kyc_account_data.dart new file mode 100644 index 0000000..ad8c27f --- /dev/null +++ b/lib/model/get_kyc_account_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetKycAccountData { + /// Returns a new [GetKycAccountData] instance. + GetKycAccountData({ + this.kycAccount, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + KycAccount? kycAccount; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetKycAccountData && + other.kycAccount == kycAccount; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (kycAccount == null ? 0 : kycAccount!.hashCode); + + @override + String toString() => 'GetKycAccountData[kycAccount=$kycAccount]'; + + Map toJson() { + final json = {}; + if (this.kycAccount != null) { + json[r'kyc_account'] = this.kycAccount; + } + return json; + } + + /// Returns a new [GetKycAccountData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetKycAccountData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetKycAccountData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetKycAccountData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetKycAccountData( + kycAccount: KycAccount.fromJson(json[r'kyc_account']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetKycAccountData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetKycAccountData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetKycAccountData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetKycAccountData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_kyc_account_response.dart b/lib/model/get_kyc_account_response.dart new file mode 100644 index 0000000..25c48ae --- /dev/null +++ b/lib/model/get_kyc_account_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetKycAccountResponse { + /// Returns a new [GetKycAccountResponse] instance. + GetKycAccountResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetKycAccountData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetKycAccountResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetKycAccountResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetKycAccountResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetKycAccountResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetKycAccountResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetKycAccountResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetKycAccountResponse( + data: GetKycAccountData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetKycAccountResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetKycAccountResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetKycAccountResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetKycAccountResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_order_data.dart b/lib/model/get_order_data.dart new file mode 100644 index 0000000..0a01ede --- /dev/null +++ b/lib/model/get_order_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetOrderData { + /// Returns a new [GetOrderData] instance. + GetOrderData({ + this.order, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Order? order; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetOrderData && + other.order == order; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (order == null ? 0 : order!.hashCode); + + @override + String toString() => 'GetOrderData[order=$order]'; + + Map toJson() { + final json = {}; + if (this.order != null) { + json[r'order'] = this.order; + } + return json; + } + + /// Returns a new [GetOrderData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetOrderData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetOrderData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetOrderData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetOrderData( + order: Order.fromJson(json[r'order']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetOrderData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetOrderData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetOrderData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetOrderData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_order_response.dart b/lib/model/get_order_response.dart new file mode 100644 index 0000000..9ad8b6e --- /dev/null +++ b/lib/model/get_order_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetOrderResponse { + /// Returns a new [GetOrderResponse] instance. + GetOrderResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetOrderData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetOrderResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetOrderResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetOrderResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetOrderResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetOrderResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetOrderResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetOrderResponse( + data: GetOrderData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetOrderResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetOrderResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetOrderResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetOrderResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_orders_data.dart b/lib/model/get_orders_data.dart new file mode 100644 index 0000000..896758d --- /dev/null +++ b/lib/model/get_orders_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetOrdersData { + /// Returns a new [GetOrdersData] instance. + GetOrdersData({ + this.orders = const [], + }); + List orders; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetOrdersData && + _deepEquality.equals(other.orders, orders); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (orders.hashCode); + + @override + String toString() => 'GetOrdersData[orders=$orders]'; + + Map toJson() { + final json = {}; + json[r'orders'] = this.orders; + return json; + } + + /// Returns a new [GetOrdersData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetOrdersData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetOrdersData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetOrdersData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetOrdersData( + orders: Order.listFromJson(json[r'orders']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetOrdersData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetOrdersData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetOrdersData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetOrdersData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_orders_response.dart b/lib/model/get_orders_response.dart new file mode 100644 index 0000000..3d97886 --- /dev/null +++ b/lib/model/get_orders_response.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetOrdersResponse { + /// Returns a new [GetOrdersResponse] instance. + GetOrdersResponse({ + this.pagination, + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Pagination? pagination; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetOrdersData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetOrdersResponse && + other.pagination == pagination && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pagination == null ? 0 : pagination!.hashCode) + + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetOrdersResponse[pagination=$pagination, data=$data]'; + + Map toJson() { + final json = {}; + if (this.pagination != null) { + json[r'pagination'] = this.pagination; + } + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetOrdersResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetOrdersResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetOrdersResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetOrdersResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetOrdersResponse( + pagination: Pagination.fromJson(json[r'pagination']), + data: GetOrdersData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetOrdersResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetOrdersResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetOrdersResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetOrdersResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_payment_methods_data.dart b/lib/model/get_payment_methods_data.dart new file mode 100644 index 0000000..0d1a4d5 --- /dev/null +++ b/lib/model/get_payment_methods_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetPaymentMethodsData { + /// Returns a new [GetPaymentMethodsData] instance. + GetPaymentMethodsData({ + this.paymentMethods = const [], + }); + List paymentMethods; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetPaymentMethodsData && + _deepEquality.equals(other.paymentMethods, paymentMethods); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (paymentMethods.hashCode); + + @override + String toString() => 'GetPaymentMethodsData[paymentMethods=$paymentMethods]'; + + Map toJson() { + final json = {}; + json[r'payment_methods'] = this.paymentMethods; + return json; + } + + /// Returns a new [GetPaymentMethodsData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetPaymentMethodsData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetPaymentMethodsData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetPaymentMethodsData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetPaymentMethodsData( + paymentMethods: PaymentMethod.listFromJson(json[r'payment_methods']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetPaymentMethodsData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetPaymentMethodsData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetPaymentMethodsData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetPaymentMethodsData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_payment_methods_response.dart b/lib/model/get_payment_methods_response.dart new file mode 100644 index 0000000..eee4989 --- /dev/null +++ b/lib/model/get_payment_methods_response.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetPaymentMethodsResponse { + /// Returns a new [GetPaymentMethodsResponse] instance. + GetPaymentMethodsResponse({ + this.pagination, + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Pagination? pagination; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetPaymentMethodsData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetPaymentMethodsResponse && + other.pagination == pagination && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (pagination == null ? 0 : pagination!.hashCode) + + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetPaymentMethodsResponse[pagination=$pagination, data=$data]'; + + Map toJson() { + final json = {}; + if (this.pagination != null) { + json[r'pagination'] = this.pagination; + } + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetPaymentMethodsResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetPaymentMethodsResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetPaymentMethodsResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetPaymentMethodsResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetPaymentMethodsResponse( + pagination: Pagination.fromJson(json[r'pagination']), + data: GetPaymentMethodsData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetPaymentMethodsResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetPaymentMethodsResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetPaymentMethodsResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetPaymentMethodsResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_prices_data.dart b/lib/model/get_prices_data.dart new file mode 100644 index 0000000..586c1aa --- /dev/null +++ b/lib/model/get_prices_data.dart @@ -0,0 +1,105 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetPricesData { + /// Returns a new [GetPricesData] instance. + GetPricesData({ + this.prices = const [], + }); + List prices; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetPricesData && + _deepEquality.equals(other.prices, prices); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (prices.hashCode); + + @override + String toString() => 'GetPricesData[prices=$prices]'; + + Map toJson() { + final json = {}; + json[r'prices'] = this.prices; + return json; + } + + /// Returns a new [GetPricesData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetPricesData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetPricesData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetPricesData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetPricesData( + prices: Price.listFromJson(json[r'prices']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetPricesData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetPricesData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetPricesData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetPricesData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_prices_response.dart b/lib/model/get_prices_response.dart new file mode 100644 index 0000000..5a70961 --- /dev/null +++ b/lib/model/get_prices_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetPricesResponse { + /// Returns a new [GetPricesResponse] instance. + GetPricesResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetPricesData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetPricesResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetPricesResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetPricesResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetPricesResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetPricesResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetPricesResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetPricesResponse( + data: GetPricesData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetPricesResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetPricesResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetPricesResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetPricesResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_quote_data.dart b/lib/model/get_quote_data.dart new file mode 100644 index 0000000..f36c1e1 --- /dev/null +++ b/lib/model/get_quote_data.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetQuoteData { + /// Returns a new [GetQuoteData] instance. + GetQuoteData({ + this.quote, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + Quote? quote; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetQuoteData && + other.quote == quote; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (quote == null ? 0 : quote!.hashCode); + + @override + String toString() => 'GetQuoteData[quote=$quote]'; + + Map toJson() { + final json = {}; + if (this.quote != null) { + json[r'quote'] = this.quote; + } + return json; + } + + /// Returns a new [GetQuoteData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetQuoteData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetQuoteData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetQuoteData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetQuoteData( + quote: Quote.fromJson(json[r'quote']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetQuoteData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetQuoteData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetQuoteData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetQuoteData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/get_quote_response.dart b/lib/model/get_quote_response.dart new file mode 100644 index 0000000..36abe66 --- /dev/null +++ b/lib/model/get_quote_response.dart @@ -0,0 +1,113 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class GetQuoteResponse { + /// Returns a new [GetQuoteResponse] instance. + GetQuoteResponse({ + this.data, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + GetQuoteData? data; + + @override + bool operator ==(Object other) => identical(this, other) || other is GetQuoteResponse && + other.data == data; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (data == null ? 0 : data!.hashCode); + + @override + String toString() => 'GetQuoteResponse[data=$data]'; + + Map toJson() { + final json = {}; + if (this.data != null) { + json[r'data'] = this.data; + } + return json; + } + + /// Returns a new [GetQuoteResponse] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static GetQuoteResponse? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "GetQuoteResponse[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "GetQuoteResponse[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return GetQuoteResponse( + data: GetQuoteData.fromJson(json[r'data']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = GetQuoteResponse.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = GetQuoteResponse.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of GetQuoteResponse-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = GetQuoteResponse.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/kyc_account.dart b/lib/model/kyc_account.dart new file mode 100644 index 0000000..7fe7bdd --- /dev/null +++ b/lib/model/kyc_account.dart @@ -0,0 +1,197 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class KycAccount { + /// Returns a new [KycAccount] instance. + KycAccount({ + this.accountReference, + this.kycApplicationId, + this.kycStatus, + this.kycUrl, + this.kycShares = const [], + this.createdAt, + this.updatedAt, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? accountReference; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? kycApplicationId; + + /// Overall KYC status for the account. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? kycStatus; + + /// URL to redirect the user to for KYC process if action is required. + String? kycUrl; + + List? kycShares; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? createdAt; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? updatedAt; + + @override + bool operator ==(Object other) => identical(this, other) || other is KycAccount && + other.accountReference == accountReference && + other.kycApplicationId == kycApplicationId && + other.kycStatus == kycStatus && + other.kycUrl == kycUrl && + _deepEquality.equals(other.kycShares, kycShares) && + other.createdAt == createdAt && + other.updatedAt == updatedAt; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (accountReference == null ? 0 : accountReference!.hashCode) + + (kycApplicationId == null ? 0 : kycApplicationId!.hashCode) + + (kycStatus == null ? 0 : kycStatus!.hashCode) + + (kycUrl == null ? 0 : kycUrl!.hashCode) + + (kycShares == null ? 0 : kycShares!.hashCode) + + (createdAt == null ? 0 : createdAt!.hashCode) + + (updatedAt == null ? 0 : updatedAt!.hashCode); + + @override + String toString() => 'KycAccount[accountReference=$accountReference, kycApplicationId=$kycApplicationId, kycStatus=$kycStatus, kycUrl=$kycUrl, kycShares=$kycShares, createdAt=$createdAt, updatedAt=$updatedAt]'; + + Map toJson() { + final json = {}; + if (this.accountReference != null) { + json[r'account_reference'] = this.accountReference; + } + if (this.kycApplicationId != null) { + json[r'kyc_application_id'] = this.kycApplicationId; + } + if (this.kycStatus != null) { + json[r'kyc_status'] = this.kycStatus; + } + if (this.kycUrl != null) { + json[r'kyc_url'] = this.kycUrl; + } else { + json[r'kyc_url'] = null; + } + if (this.kycShares != null) { + json[r'kyc_shares'] = this.kycShares; + } else { + json[r'kyc_shares'] = null; + } + if (this.createdAt != null) { + json[r'created_at'] = this.createdAt!.toUtc().toIso8601String(); + } + if (this.updatedAt != null) { + json[r'updated_at'] = this.updatedAt!.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [KycAccount] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static KycAccount? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "KycAccount[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "KycAccount[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return KycAccount( + accountReference: mapValueOfType(json, r'account_reference'), + kycApplicationId: mapValueOfType(json, r'kyc_application_id'), + kycStatus: mapValueOfType(json, r'kyc_status'), + kycUrl: mapValueOfType(json, r'kyc_url'), + kycShares: KycShare.listFromJson(json[r'kyc_shares']), + createdAt: mapDateTime(json, r'created_at', r''), + updatedAt: mapDateTime(json, r'updated_at', r''), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = KycAccount.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = KycAccount.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of KycAccount-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = KycAccount.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/kyc_document_image.dart b/lib/model/kyc_document_image.dart new file mode 100644 index 0000000..c14dfbe --- /dev/null +++ b/lib/model/kyc_document_image.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class KycDocumentImage { + /// Returns a new [KycDocumentImage] instance. + KycDocumentImage({ + required this.url, + required this.contentType, + this.fileName, + }); + /// URL of the uploaded document image (e.g., pre-signed S3 URL). + String url; + + /// MIME type of the image. + String contentType; + + /// Original file name of the image. + String? fileName; + + @override + bool operator ==(Object other) => identical(this, other) || other is KycDocumentImage && + other.url == url && + other.contentType == contentType && + other.fileName == fileName; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (url.hashCode) + + (contentType.hashCode) + + (fileName == null ? 0 : fileName!.hashCode); + + @override + String toString() => 'KycDocumentImage[url=$url, contentType=$contentType, fileName=$fileName]'; + + Map toJson() { + final json = {}; + json[r'url'] = this.url; + json[r'content_type'] = this.contentType; + if (this.fileName != null) { + json[r'file_name'] = this.fileName; + } else { + json[r'file_name'] = null; + } + return json; + } + + /// Returns a new [KycDocumentImage] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static KycDocumentImage? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "KycDocumentImage[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "KycDocumentImage[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return KycDocumentImage( + url: mapValueOfType(json, r'url')!, + contentType: mapValueOfType(json, r'content_type')!, + fileName: mapValueOfType(json, r'file_name'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = KycDocumentImage.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = KycDocumentImage.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of KycDocumentImage-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = KycDocumentImage.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + 'url', + 'content_type', + }; +} diff --git a/lib/model/kyc_share.dart b/lib/model/kyc_share.dart new file mode 100644 index 0000000..6a9e564 --- /dev/null +++ b/lib/model/kyc_share.dart @@ -0,0 +1,128 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class KycShare { + /// Returns a new [KycShare] instance. + KycShare({ + this.partnerName, + this.status, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? partnerName; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + @override + bool operator ==(Object other) => identical(this, other) || other is KycShare && + other.partnerName == partnerName && + other.status == status; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (partnerName == null ? 0 : partnerName!.hashCode) + + (status == null ? 0 : status!.hashCode); + + @override + String toString() => 'KycShare[partnerName=$partnerName, status=$status]'; + + Map toJson() { + final json = {}; + if (this.partnerName != null) { + json[r'partner_name'] = this.partnerName; + } + if (this.status != null) { + json[r'status'] = this.status; + } + return json; + } + + /// Returns a new [KycShare] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static KycShare? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "KycShare[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "KycShare[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return KycShare( + partnerName: mapValueOfType(json, r'partner_name'), + status: mapValueOfType(json, r'status'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = KycShare.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = KycShare.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of KycShare-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = KycShare.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/nft_checkout_data.dart b/lib/model/nft_checkout_data.dart new file mode 100644 index 0000000..a1706a7 --- /dev/null +++ b/lib/model/nft_checkout_data.dart @@ -0,0 +1,250 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class NftCheckoutData { + /// Returns a new [NftCheckoutData] instance. + NftCheckoutData({ + this.name, + this.quantity, + this.imageUrl, + this.collectionName, + this.totalPrice, + this.priceCurrency, + this.nftId, + this.collectionId, + this.description, + this.contractAddress, + this.attributes = const [], + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? name; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? quantity; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? imageUrl; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? collectionName; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? totalPrice; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? priceCurrency; + + String? nftId; + + String? collectionId; + + String? description; + + String? contractAddress; + + List>? attributes; + + @override + bool operator ==(Object other) => identical(this, other) || other is NftCheckoutData && + other.name == name && + other.quantity == quantity && + other.imageUrl == imageUrl && + other.collectionName == collectionName && + other.totalPrice == totalPrice && + other.priceCurrency == priceCurrency && + other.nftId == nftId && + other.collectionId == collectionId && + other.description == description && + other.contractAddress == contractAddress && + _deepEquality.equals(other.attributes, attributes); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (name == null ? 0 : name!.hashCode) + + (quantity == null ? 0 : quantity!.hashCode) + + (imageUrl == null ? 0 : imageUrl!.hashCode) + + (collectionName == null ? 0 : collectionName!.hashCode) + + (totalPrice == null ? 0 : totalPrice!.hashCode) + + (priceCurrency == null ? 0 : priceCurrency!.hashCode) + + (nftId == null ? 0 : nftId!.hashCode) + + (collectionId == null ? 0 : collectionId!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (contractAddress == null ? 0 : contractAddress!.hashCode) + + (attributes == null ? 0 : attributes!.hashCode); + + @override + String toString() => 'NftCheckoutData[name=$name, quantity=$quantity, imageUrl=$imageUrl, collectionName=$collectionName, totalPrice=$totalPrice, priceCurrency=$priceCurrency, nftId=$nftId, collectionId=$collectionId, description=$description, contractAddress=$contractAddress, attributes=$attributes]'; + + Map toJson() { + final json = {}; + if (this.name != null) { + json[r'name'] = this.name; + } + if (this.quantity != null) { + json[r'quantity'] = this.quantity; + } + if (this.imageUrl != null) { + json[r'image_url'] = this.imageUrl; + } + if (this.collectionName != null) { + json[r'collection_name'] = this.collectionName; + } + if (this.totalPrice != null) { + json[r'total_price'] = this.totalPrice; + } + if (this.priceCurrency != null) { + json[r'price_currency'] = this.priceCurrency; + } + if (this.nftId != null) { + json[r'nft_id'] = this.nftId; + } else { + json[r'nft_id'] = null; + } + if (this.collectionId != null) { + json[r'collection_id'] = this.collectionId; + } else { + json[r'collection_id'] = null; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + if (this.contractAddress != null) { + json[r'contract_address'] = this.contractAddress; + } else { + json[r'contract_address'] = null; + } + if (this.attributes != null) { + json[r'attributes'] = this.attributes; + } else { + json[r'attributes'] = null; + } + return json; + } + + /// Returns a new [NftCheckoutData] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static NftCheckoutData? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "NftCheckoutData[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "NftCheckoutData[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return NftCheckoutData( + name: mapValueOfType(json, r'name'), + quantity: mapValueOfType(json, r'quantity'), + imageUrl: mapValueOfType(json, r'image_url'), + collectionName: mapValueOfType(json, r'collection_name'), + totalPrice: mapValueOfType(json, r'total_price'), + priceCurrency: mapValueOfType(json, r'price_currency'), + nftId: mapValueOfType(json, r'nft_id'), + collectionId: mapValueOfType(json, r'collection_id'), + description: mapValueOfType(json, r'description'), + contractAddress: mapValueOfType(json, r'contract_address'), + attributes: json[r'attributes'] is List + ? (json[r'attributes'] as List) + .whereType>() + .toList() + : json[r'attributes'] is Map + ? [Map.from(json[r'attributes'] as Map)] + : null, + + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = NftCheckoutData.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = NftCheckoutData.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of NftCheckoutData-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = NftCheckoutData.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/order.dart b/lib/model/order.dart new file mode 100644 index 0000000..de9f03d --- /dev/null +++ b/lib/model/order.dart @@ -0,0 +1,349 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Order { + /// Returns a new [Order] instance. + Order({ + this.id, + this.accountReference, + this.orderType, + this.fiatCurrency, + this.coinCurrency, + this.fiatAmount, + this.coinAmount, + this.walletAddress, + this.walletAddressTag, + this.blockchain, + this.status, + this.checkoutUrl, + this.depositAddress, + this.paymentId, + this.transactionId, + this.paymentMethodId, + this.feeAmount, + this.networkFeeAmount, + this.createdAt, + }); + /// Unique Banxa order ID. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? id; + + /// Your internal reference for the user/account. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? accountReference; + + /// Type of order. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? orderType; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatCurrency; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinCurrency; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatAmount; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinAmount; + + String? walletAddress; + + String? walletAddressTag; + + String? blockchain; + + /// Current status of the order. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + /// URL for the user to complete payment or KYC. + String? checkoutUrl; + + OrderDepositAddress? depositAddress; + + String? paymentId; + + String? transactionId; + + int? paymentMethodId; + + String? feeAmount; + + String? networkFeeAmount; + + /// Timestamp when the order was created. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? createdAt; + + @override + bool operator ==(Object other) => identical(this, other) || other is Order && + other.id == id && + other.accountReference == accountReference && + other.orderType == orderType && + other.fiatCurrency == fiatCurrency && + other.coinCurrency == coinCurrency && + other.fiatAmount == fiatAmount && + other.coinAmount == coinAmount && + other.walletAddress == walletAddress && + other.walletAddressTag == walletAddressTag && + other.blockchain == blockchain && + other.status == status && + other.checkoutUrl == checkoutUrl && + other.depositAddress == depositAddress && + other.paymentId == paymentId && + other.transactionId == transactionId && + other.paymentMethodId == paymentMethodId && + other.feeAmount == feeAmount && + other.networkFeeAmount == networkFeeAmount && + other.createdAt == createdAt; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (accountReference == null ? 0 : accountReference!.hashCode) + + (orderType == null ? 0 : orderType!.hashCode) + + (fiatCurrency == null ? 0 : fiatCurrency!.hashCode) + + (coinCurrency == null ? 0 : coinCurrency!.hashCode) + + (fiatAmount == null ? 0 : fiatAmount!.hashCode) + + (coinAmount == null ? 0 : coinAmount!.hashCode) + + (walletAddress == null ? 0 : walletAddress!.hashCode) + + (walletAddressTag == null ? 0 : walletAddressTag!.hashCode) + + (blockchain == null ? 0 : blockchain!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (checkoutUrl == null ? 0 : checkoutUrl!.hashCode) + + (depositAddress == null ? 0 : depositAddress!.hashCode) + + (paymentId == null ? 0 : paymentId!.hashCode) + + (transactionId == null ? 0 : transactionId!.hashCode) + + (paymentMethodId == null ? 0 : paymentMethodId!.hashCode) + + (feeAmount == null ? 0 : feeAmount!.hashCode) + + (networkFeeAmount == null ? 0 : networkFeeAmount!.hashCode) + + (createdAt == null ? 0 : createdAt!.hashCode); + + @override + String toString() => 'Order[id=$id, accountReference=$accountReference, orderType=$orderType, fiatCurrency=$fiatCurrency, coinCurrency=$coinCurrency, fiatAmount=$fiatAmount, coinAmount=$coinAmount, walletAddress=$walletAddress, walletAddressTag=$walletAddressTag, blockchain=$blockchain, status=$status, checkoutUrl=$checkoutUrl, depositAddress=$depositAddress, paymentId=$paymentId, transactionId=$transactionId, paymentMethodId=$paymentMethodId, feeAmount=$feeAmount, networkFeeAmount=$networkFeeAmount, createdAt=$createdAt]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } + if (this.accountReference != null) { + json[r'account_reference'] = this.accountReference; + } + if (this.orderType != null) { + json[r'order_type'] = this.orderType; + } + if (this.fiatCurrency != null) { + json[r'fiat_currency'] = this.fiatCurrency; + } + if (this.coinCurrency != null) { + json[r'coin_currency'] = this.coinCurrency; + } + if (this.fiatAmount != null) { + json[r'fiat_amount'] = this.fiatAmount; + } + if (this.coinAmount != null) { + json[r'coin_amount'] = this.coinAmount; + } + if (this.walletAddress != null) { + json[r'wallet_address'] = this.walletAddress; + } else { + json[r'wallet_address'] = null; + } + if (this.walletAddressTag != null) { + json[r'wallet_address_tag'] = this.walletAddressTag; + } else { + json[r'wallet_address_tag'] = null; + } + if (this.blockchain != null) { + json[r'blockchain'] = this.blockchain; + } else { + json[r'blockchain'] = null; + } + if (this.status != null) { + json[r'status'] = this.status; + } + if (this.checkoutUrl != null) { + json[r'checkout_url'] = this.checkoutUrl; + } else { + json[r'checkout_url'] = null; + } + if (this.depositAddress != null) { + json[r'deposit_address'] = this.depositAddress; + } else { + json[r'deposit_address'] = null; + } + if (this.paymentId != null) { + json[r'payment_id'] = this.paymentId; + } else { + json[r'payment_id'] = null; + } + if (this.transactionId != null) { + json[r'transaction_id'] = this.transactionId; + } else { + json[r'transaction_id'] = null; + } + if (this.paymentMethodId != null) { + json[r'payment_method_id'] = this.paymentMethodId; + } else { + json[r'payment_method_id'] = null; + } + if (this.feeAmount != null) { + json[r'fee_amount'] = this.feeAmount; + } else { + json[r'fee_amount'] = null; + } + if (this.networkFeeAmount != null) { + json[r'network_fee_amount'] = this.networkFeeAmount; + } else { + json[r'network_fee_amount'] = null; + } + if (this.createdAt != null) { + json[r'created_at'] = this.createdAt!.toUtc().toIso8601String(); + } + return json; + } + + /// Returns a new [Order] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Order? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Order[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Order[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Order( + id: mapValueOfType(json, r'id'), + accountReference: mapValueOfType(json, r'account_reference'), + orderType: mapValueOfType(json, r'order_type'), + fiatCurrency: mapValueOfType(json, r'fiat_currency'), + coinCurrency: mapValueOfType(json, r'coin_currency'), + fiatAmount: mapValueOfType(json, r'fiat_amount'), + coinAmount: mapValueOfType(json, r'coin_amount'), + walletAddress: mapValueOfType(json, r'wallet_address'), + walletAddressTag: mapValueOfType(json, r'wallet_address_tag'), + blockchain: mapValueOfType(json, r'blockchain'), + status: mapValueOfType(json, r'status'), + checkoutUrl: mapValueOfType(json, r'checkout_url'), + depositAddress: OrderDepositAddress.fromJson(json[r'deposit_address']), + paymentId: mapValueOfType(json, r'payment_id'), + transactionId: mapValueOfType(json, r'transaction_id'), + paymentMethodId: mapValueOfType(json, r'payment_method_id'), + feeAmount: mapValueOfType(json, r'fee_amount'), + networkFeeAmount: mapValueOfType(json, r'network_fee_amount'), + createdAt: mapDateTime(json, r'created_at', r''), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Order.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Order.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Order-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Order.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/order_deposit_address.dart b/lib/model/order_deposit_address.dart new file mode 100644 index 0000000..36f5b48 --- /dev/null +++ b/lib/model/order_deposit_address.dart @@ -0,0 +1,135 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class OrderDepositAddress { + /// Returns a new [OrderDepositAddress] instance. + OrderDepositAddress({ + this.address, + this.memo, + this.uri, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? address; + + String? memo; + + String? uri; + + @override + bool operator ==(Object other) => identical(this, other) || other is OrderDepositAddress && + other.address == address && + other.memo == memo && + other.uri == uri; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (address == null ? 0 : address!.hashCode) + + (memo == null ? 0 : memo!.hashCode) + + (uri == null ? 0 : uri!.hashCode); + + @override + String toString() => 'OrderDepositAddress[address=$address, memo=$memo, uri=$uri]'; + + Map toJson() { + final json = {}; + if (this.address != null) { + json[r'address'] = this.address; + } + if (this.memo != null) { + json[r'memo'] = this.memo; + } else { + json[r'memo'] = null; + } + if (this.uri != null) { + json[r'uri'] = this.uri; + } else { + json[r'uri'] = null; + } + return json; + } + + /// Returns a new [OrderDepositAddress] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static OrderDepositAddress? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "OrderDepositAddress[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "OrderDepositAddress[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return OrderDepositAddress( + address: mapValueOfType(json, r'address'), + memo: mapValueOfType(json, r'memo'), + uri: mapValueOfType(json, r'uri'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = OrderDepositAddress.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = OrderDepositAddress.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of OrderDepositAddress-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = OrderDepositAddress.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/pagination.dart b/lib/model/pagination.dart new file mode 100644 index 0000000..41a2ba8 --- /dev/null +++ b/lib/model/pagination.dart @@ -0,0 +1,158 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Pagination { + /// Returns a new [Pagination] instance. + Pagination({ + this.currentPage, + this.recordsPerPage, + this.totalRecords, + this.totalPages, + }); + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? currentPage; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? recordsPerPage; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? totalRecords; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? totalPages; + + @override + bool operator ==(Object other) => identical(this, other) || other is Pagination && + other.currentPage == currentPage && + other.recordsPerPage == recordsPerPage && + other.totalRecords == totalRecords && + other.totalPages == totalPages; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (currentPage == null ? 0 : currentPage!.hashCode) + + (recordsPerPage == null ? 0 : recordsPerPage!.hashCode) + + (totalRecords == null ? 0 : totalRecords!.hashCode) + + (totalPages == null ? 0 : totalPages!.hashCode); + + @override + String toString() => 'Pagination[currentPage=$currentPage, recordsPerPage=$recordsPerPage, totalRecords=$totalRecords, totalPages=$totalPages]'; + + Map toJson() { + final json = {}; + if (this.currentPage != null) { + json[r'current_page'] = this.currentPage; + } + if (this.recordsPerPage != null) { + json[r'records_per_page'] = this.recordsPerPage; + } + if (this.totalRecords != null) { + json[r'total_records'] = this.totalRecords; + } + if (this.totalPages != null) { + json[r'total_pages'] = this.totalPages; + } + return json; + } + + /// Returns a new [Pagination] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Pagination? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Pagination[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Pagination[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Pagination( + currentPage: mapValueOfType(json, r'current_page'), + recordsPerPage: mapValueOfType(json, r'records_per_page'), + totalRecords: mapValueOfType(json, r'total_records'), + totalPages: mapValueOfType(json, r'total_pages'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Pagination.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Pagination.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Pagination-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Pagination.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/payment_method.dart b/lib/model/payment_method.dart new file mode 100644 index 0000000..b931ec0 --- /dev/null +++ b/lib/model/payment_method.dart @@ -0,0 +1,333 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class PaymentMethod { + /// Returns a new [PaymentMethod] instance. + PaymentMethod({ + this.id, + this.paymentMethodType, + this.name, + this.status, + this.logoUrl, + this.description, + this.transactionFees = const [], + this.supportedFiat = const [], + this.supportedCoin = const [], + this.minAmount, + this.maxAmount, + this.isCard, + this.isBankTransfer, + this.isWallet, + this.isInstantSettlement, + this.isPushPayment, + this.isPullPayment, + this.countriesAllowed = const [], + this.countriesBlocked = const [], + }); + /// Unique identifier for the payment method. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? id; + + /// Type of payment method. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? paymentMethodType; + + /// Display name of the payment method. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? name; + + /// Status of the payment method. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? status; + + /// URL of the payment method's logo. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? logoUrl; + + /// Description of the payment method. + String? description; + + List transactionFees; + + /// List of supported fiat currency codes. + List supportedFiat; + + /// List of supported coin codes. + List supportedCoin; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? minAmount; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? maxAmount; + + bool? isCard; + + bool? isBankTransfer; + + bool? isWallet; + + bool? isInstantSettlement; + + bool? isPushPayment; + + bool? isPullPayment; + + /// List of ISO 3166-1 alpha-2 country codes where this payment method is allowed. + List countriesAllowed; + + /// List of ISO 3166-1 alpha-2 country codes where this payment method is blocked. + List countriesBlocked; + + @override + bool operator ==(Object other) => identical(this, other) || other is PaymentMethod && + other.id == id && + other.paymentMethodType == paymentMethodType && + other.name == name && + other.status == status && + other.logoUrl == logoUrl && + other.description == description && + _deepEquality.equals(other.transactionFees, transactionFees) && + _deepEquality.equals(other.supportedFiat, supportedFiat) && + _deepEquality.equals(other.supportedCoin, supportedCoin) && + other.minAmount == minAmount && + other.maxAmount == maxAmount && + other.isCard == isCard && + other.isBankTransfer == isBankTransfer && + other.isWallet == isWallet && + other.isInstantSettlement == isInstantSettlement && + other.isPushPayment == isPushPayment && + other.isPullPayment == isPullPayment && + _deepEquality.equals(other.countriesAllowed, countriesAllowed) && + _deepEquality.equals(other.countriesBlocked, countriesBlocked); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (paymentMethodType == null ? 0 : paymentMethodType!.hashCode) + + (name == null ? 0 : name!.hashCode) + + (status == null ? 0 : status!.hashCode) + + (logoUrl == null ? 0 : logoUrl!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (transactionFees.hashCode) + + (supportedFiat.hashCode) + + (supportedCoin.hashCode) + + (minAmount == null ? 0 : minAmount!.hashCode) + + (maxAmount == null ? 0 : maxAmount!.hashCode) + + (isCard == null ? 0 : isCard!.hashCode) + + (isBankTransfer == null ? 0 : isBankTransfer!.hashCode) + + (isWallet == null ? 0 : isWallet!.hashCode) + + (isInstantSettlement == null ? 0 : isInstantSettlement!.hashCode) + + (isPushPayment == null ? 0 : isPushPayment!.hashCode) + + (isPullPayment == null ? 0 : isPullPayment!.hashCode) + + (countriesAllowed.hashCode) + + (countriesBlocked.hashCode); + + @override + String toString() => 'PaymentMethod[id=$id, paymentMethodType=$paymentMethodType, name=$name, status=$status, logoUrl=$logoUrl, description=$description, transactionFees=$transactionFees, supportedFiat=$supportedFiat, supportedCoin=$supportedCoin, minAmount=$minAmount, maxAmount=$maxAmount, isCard=$isCard, isBankTransfer=$isBankTransfer, isWallet=$isWallet, isInstantSettlement=$isInstantSettlement, isPushPayment=$isPushPayment, isPullPayment=$isPullPayment, countriesAllowed=$countriesAllowed, countriesBlocked=$countriesBlocked]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } + if (this.paymentMethodType != null) { + json[r'payment_method_type'] = this.paymentMethodType; + } + if (this.name != null) { + json[r'name'] = this.name; + } + if (this.status != null) { + json[r'status'] = this.status; + } + if (this.logoUrl != null) { + json[r'logo_url'] = this.logoUrl; + } + if (this.description != null) { + json[r'description'] = this.description; + } else { + json[r'description'] = null; + } + json[r'transaction_fees'] = this.transactionFees; + json[r'supported_fiat'] = this.supportedFiat; + json[r'supported_coin'] = this.supportedCoin; + if (this.minAmount != null) { + json[r'min_amount'] = this.minAmount; + } + if (this.maxAmount != null) { + json[r'max_amount'] = this.maxAmount; + } + if (this.isCard != null) { + json[r'is_card'] = this.isCard; + } else { + json[r'is_card'] = null; + } + if (this.isBankTransfer != null) { + json[r'is_bank_transfer'] = this.isBankTransfer; + } else { + json[r'is_bank_transfer'] = null; + } + if (this.isWallet != null) { + json[r'is_wallet'] = this.isWallet; + } else { + json[r'is_wallet'] = null; + } + if (this.isInstantSettlement != null) { + json[r'is_instant_settlement'] = this.isInstantSettlement; + } else { + json[r'is_instant_settlement'] = null; + } + if (this.isPushPayment != null) { + json[r'is_push_payment'] = this.isPushPayment; + } else { + json[r'is_push_payment'] = null; + } + if (this.isPullPayment != null) { + json[r'is_pull_payment'] = this.isPullPayment; + } else { + json[r'is_pull_payment'] = null; + } + json[r'countries_allowed'] = this.countriesAllowed; + json[r'countries_blocked'] = this.countriesBlocked; + return json; + } + + /// Returns a new [PaymentMethod] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static PaymentMethod? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "PaymentMethod[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "PaymentMethod[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return PaymentMethod( + id: mapValueOfType(json, r'id'), + paymentMethodType: mapValueOfType(json, r'payment_method_type'), + name: mapValueOfType(json, r'name'), + status: mapValueOfType(json, r'status'), + logoUrl: mapValueOfType(json, r'logo_url'), + description: mapValueOfType(json, r'description'), + transactionFees: TransactionFee.listFromJson(json[r'transaction_fees']), + supportedFiat: json[r'supported_fiat'] is Iterable + ? (json[r'supported_fiat'] as Iterable).cast().toList(growable: false) + : const [], + supportedCoin: json[r'supported_coin'] is Iterable + ? (json[r'supported_coin'] as Iterable).cast().toList(growable: false) + : const [], + minAmount: mapValueOfType(json, r'min_amount'), + maxAmount: mapValueOfType(json, r'max_amount'), + isCard: mapValueOfType(json, r'is_card'), + isBankTransfer: mapValueOfType(json, r'is_bank_transfer'), + isWallet: mapValueOfType(json, r'is_wallet'), + isInstantSettlement: mapValueOfType(json, r'is_instant_settlement'), + isPushPayment: mapValueOfType(json, r'is_push_payment'), + isPullPayment: mapValueOfType(json, r'is_pull_payment'), + countriesAllowed: json[r'countries_allowed'] is Iterable + ? (json[r'countries_allowed'] as Iterable).cast().toList(growable: false) + : const [], + countriesBlocked: json[r'countries_blocked'] is Iterable + ? (json[r'countries_blocked'] as Iterable).cast().toList(growable: false) + : const [], + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = PaymentMethod.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = PaymentMethod.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of PaymentMethod-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = PaymentMethod.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/price.dart b/lib/model/price.dart new file mode 100644 index 0000000..9712731 --- /dev/null +++ b/lib/model/price.dart @@ -0,0 +1,228 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Price { + /// Returns a new [Price] instance. + Price({ + this.paymentMethodId, + this.spotPriceFee, + this.spotPriceIncludingFee, + this.coinAmount, + this.coinCode, + this.fiatAmount, + this.fiatCode, + this.networkFee, + this.blockchainFee, + }); + /// ID of the payment method these prices apply to. + int? paymentMethodId; + + /// Fee included in the spot price. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? spotPriceFee; + + /// Spot price including fees. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? spotPriceIncludingFee; + + /// Amount of coin. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinAmount; + + /// Coin code. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinCode; + + /// Amount of fiat. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatAmount; + + /// Fiat code. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatCode; + + String? networkFee; + + String? blockchainFee; + + @override + bool operator ==(Object other) => identical(this, other) || other is Price && + other.paymentMethodId == paymentMethodId && + other.spotPriceFee == spotPriceFee && + other.spotPriceIncludingFee == spotPriceIncludingFee && + other.coinAmount == coinAmount && + other.coinCode == coinCode && + other.fiatAmount == fiatAmount && + other.fiatCode == fiatCode && + other.networkFee == networkFee && + other.blockchainFee == blockchainFee; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (paymentMethodId == null ? 0 : paymentMethodId!.hashCode) + + (spotPriceFee == null ? 0 : spotPriceFee!.hashCode) + + (spotPriceIncludingFee == null ? 0 : spotPriceIncludingFee!.hashCode) + + (coinAmount == null ? 0 : coinAmount!.hashCode) + + (coinCode == null ? 0 : coinCode!.hashCode) + + (fiatAmount == null ? 0 : fiatAmount!.hashCode) + + (fiatCode == null ? 0 : fiatCode!.hashCode) + + (networkFee == null ? 0 : networkFee!.hashCode) + + (blockchainFee == null ? 0 : blockchainFee!.hashCode); + + @override + String toString() => 'Price[paymentMethodId=$paymentMethodId, spotPriceFee=$spotPriceFee, spotPriceIncludingFee=$spotPriceIncludingFee, coinAmount=$coinAmount, coinCode=$coinCode, fiatAmount=$fiatAmount, fiatCode=$fiatCode, networkFee=$networkFee, blockchainFee=$blockchainFee]'; + + Map toJson() { + final json = {}; + if (this.paymentMethodId != null) { + json[r'payment_method_id'] = this.paymentMethodId; + } else { + json[r'payment_method_id'] = null; + } + if (this.spotPriceFee != null) { + json[r'spot_price_fee'] = this.spotPriceFee; + } + if (this.spotPriceIncludingFee != null) { + json[r'spot_price_including_fee'] = this.spotPriceIncludingFee; + } + if (this.coinAmount != null) { + json[r'coin_amount'] = this.coinAmount; + } + if (this.coinCode != null) { + json[r'coin_code'] = this.coinCode; + } + if (this.fiatAmount != null) { + json[r'fiat_amount'] = this.fiatAmount; + } + if (this.fiatCode != null) { + json[r'fiat_code'] = this.fiatCode; + } + if (this.networkFee != null) { + json[r'network_fee'] = this.networkFee; + } else { + json[r'network_fee'] = null; + } + if (this.blockchainFee != null) { + json[r'blockchain_fee'] = this.blockchainFee; + } else { + json[r'blockchain_fee'] = null; + } + return json; + } + + /// Returns a new [Price] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Price? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Price[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Price[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Price( + paymentMethodId: mapValueOfType(json, r'payment_method_id'), + spotPriceFee: mapValueOfType(json, r'spot_price_fee'), + spotPriceIncludingFee: mapValueOfType(json, r'spot_price_including_fee'), + coinAmount: mapValueOfType(json, r'coin_amount'), + coinCode: mapValueOfType(json, r'coin_code'), + fiatAmount: mapValueOfType(json, r'fiat_amount'), + fiatCode: mapValueOfType(json, r'fiat_code'), + networkFee: mapValueOfType(json, r'network_fee'), + blockchainFee: mapValueOfType(json, r'blockchain_fee'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Price.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Price.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Price-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Price.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/quote.dart b/lib/model/quote.dart new file mode 100644 index 0000000..3ab81c0 --- /dev/null +++ b/lib/model/quote.dart @@ -0,0 +1,232 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class Quote { + /// Returns a new [Quote] instance. + Quote({ + this.id, + this.accountReference, + this.fiatCurrency, + this.coinCurrency, + this.fiatAmount, + this.coinAmount, + this.expiresAt, + this.createdAt, + this.prices = const [], + }); + /// Unique identifier for the quote. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + int? id; + + /// Your internal reference for the user/account. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? accountReference; + + /// Fiat currency code involved in the quote. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatCurrency; + + /// Coin currency code involved in the quote. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinCurrency; + + /// Amount in fiat currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? fiatAmount; + + /// Amount in coin currency. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? coinAmount; + + /// Timestamp when the quote expires. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? expiresAt; + + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + DateTime? createdAt; + + List prices; + + @override + bool operator ==(Object other) => identical(this, other) || other is Quote && + other.id == id && + other.accountReference == accountReference && + other.fiatCurrency == fiatCurrency && + other.coinCurrency == coinCurrency && + other.fiatAmount == fiatAmount && + other.coinAmount == coinAmount && + other.expiresAt == expiresAt && + other.createdAt == createdAt && + _deepEquality.equals(other.prices, prices); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (accountReference == null ? 0 : accountReference!.hashCode) + + (fiatCurrency == null ? 0 : fiatCurrency!.hashCode) + + (coinCurrency == null ? 0 : coinCurrency!.hashCode) + + (fiatAmount == null ? 0 : fiatAmount!.hashCode) + + (coinAmount == null ? 0 : coinAmount!.hashCode) + + (expiresAt == null ? 0 : expiresAt!.hashCode) + + (createdAt == null ? 0 : createdAt!.hashCode) + + (prices.hashCode); + + @override + String toString() => 'Quote[id=$id, accountReference=$accountReference, fiatCurrency=$fiatCurrency, coinCurrency=$coinCurrency, fiatAmount=$fiatAmount, coinAmount=$coinAmount, expiresAt=$expiresAt, createdAt=$createdAt, prices=$prices]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } + if (this.accountReference != null) { + json[r'account_reference'] = this.accountReference; + } + if (this.fiatCurrency != null) { + json[r'fiat_currency'] = this.fiatCurrency; + } + if (this.coinCurrency != null) { + json[r'coin_currency'] = this.coinCurrency; + } + if (this.fiatAmount != null) { + json[r'fiat_amount'] = this.fiatAmount; + } + if (this.coinAmount != null) { + json[r'coin_amount'] = this.coinAmount; + } + if (this.expiresAt != null) { + json[r'expires_at'] = this.expiresAt!.toUtc().toIso8601String(); + } + if (this.createdAt != null) { + json[r'created_at'] = this.createdAt!.toUtc().toIso8601String(); + } + json[r'prices'] = this.prices; + return json; + } + + /// Returns a new [Quote] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static Quote? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "Quote[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "Quote[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return Quote( + id: mapValueOfType(json, r'id'), + accountReference: mapValueOfType(json, r'account_reference'), + fiatCurrency: mapValueOfType(json, r'fiat_currency'), + coinCurrency: mapValueOfType(json, r'coin_currency'), + fiatAmount: mapValueOfType(json, r'fiat_amount'), + coinAmount: mapValueOfType(json, r'coin_amount'), + expiresAt: mapDateTime(json, r'expires_at', r''), + createdAt: mapDateTime(json, r'created_at', r''), + prices: Price.listFromJson(json[r'prices']), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = Quote.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = Quote.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of Quote-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = Quote.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/lib/model/transaction_fee.dart b/lib/model/transaction_fee.dart new file mode 100644 index 0000000..ca5fff4 --- /dev/null +++ b/lib/model/transaction_fee.dart @@ -0,0 +1,130 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of banxa; +class TransactionFee { + /// Returns a new [TransactionFee] instance. + TransactionFee({ + this.type, + this.amount, + }); + /// Type of fee (e.g., PERCENTAGE, FIXED). + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? type; + + /// Fee amount. + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + String? amount; + + @override + bool operator ==(Object other) => identical(this, other) || other is TransactionFee && + other.type == type && + other.amount == amount; + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (type == null ? 0 : type!.hashCode) + + (amount == null ? 0 : amount!.hashCode); + + @override + String toString() => 'TransactionFee[type=$type, amount=$amount]'; + + Map toJson() { + final json = {}; + if (this.type != null) { + json[r'type'] = this.type; + } + if (this.amount != null) { + json[r'amount'] = this.amount; + } + return json; + } + + /// Returns a new [TransactionFee] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static TransactionFee? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + // Ensure that the map contains the required keys. + // Note 1: the values aren't checked for validity beyond being non-null. + // Note 2: this code is stripped in release mode! + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), 'Required key "TransactionFee[$key]" is missing from JSON.'); + assert(json[key] != null, 'Required key "TransactionFee[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return TransactionFee( + type: mapValueOfType(json, r'type'), + amount: mapValueOfType(json, r'amount'), + ); + } + return null; + } + + static List listFromJson(dynamic json, {bool growable = false,}) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = TransactionFee.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = TransactionFee.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + // maps a json object with a list of TransactionFee-objects as value to a dart map + static Map> mapListFromJson(dynamic json, {bool growable = false,}) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = TransactionFee.listFromJson(entry.value, growable: growable,); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = { + }; +} diff --git a/package_config.json b/package_config.json new file mode 100644 index 0000000..47f4ddb --- /dev/null +++ b/package_config.json @@ -0,0 +1,311 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "_fe_analyzer_shared", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-61.0.0", + "packageUri": "lib/", + "languageVersion": "2.17" + }, + { + "name": "analyzer", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/analyzer-5.13.0", + "packageUri": "lib/", + "languageVersion": "2.19" + }, + { + "name": "args", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/args-2.7.0", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "async", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/async-2.13.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "boolean_selector", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "clock", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/clock-1.1.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "collection", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/collection-1.19.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "convert", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/convert-3.1.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "coverage", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/coverage-1.6.3", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "crypto", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/crypto-3.0.6", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "file", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/file-7.0.1", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "frontend_server_client", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/frontend_server_client-3.2.0", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "glob", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/glob-2.1.3", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "http", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/http-1.5.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "http_multi_server", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2", + "packageUri": "lib/", + "languageVersion": "3.2" + }, + { + "name": "http_parser", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/http_parser-4.1.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "intl", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/intl-0.20.2", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "io", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/io-1.0.5", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "js", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/js-0.6.7", + "packageUri": "lib/", + "languageVersion": "2.19" + }, + { + "name": "logging", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/logging-1.3.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "matcher", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/matcher-0.12.13", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "meta", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/meta-1.17.0", + "packageUri": "lib/", + "languageVersion": "3.5" + }, + { + "name": "mime", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/mime-2.0.0", + "packageUri": "lib/", + "languageVersion": "3.2" + }, + { + "name": "node_preamble", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/node_preamble-2.0.2", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "package_config", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/package_config-2.2.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "path", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/path-1.9.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "pool", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/pool-1.5.1", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "pub_semver", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/pub_semver-2.2.0", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "shelf", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/shelf-1.4.2", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "shelf_packages_handler", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.2", + "packageUri": "lib/", + "languageVersion": "2.17" + }, + { + "name": "shelf_static", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/shelf_static-1.1.3", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "shelf_web_socket", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/shelf_web_socket-1.0.4", + "packageUri": "lib/", + "languageVersion": "2.17" + }, + { + "name": "source_map_stack_trace", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.2", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "source_maps", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/source_maps-0.10.13", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "source_span", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/source_span-1.10.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "stack_trace", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/stack_trace-1.12.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "stream_channel", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/stream_channel-2.1.4", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "string_scanner", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/string_scanner-1.4.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "term_glyph", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/term_glyph-1.2.2", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "test", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/test-1.21.7", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "test_api", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/test_api-0.4.15", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "test_core", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/test_core-0.4.19", + "packageUri": "lib/", + "languageVersion": "2.18" + }, + { + "name": "typed_data", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/typed_data-1.4.0", + "packageUri": "lib/", + "languageVersion": "3.5" + }, + { + "name": "vm_service", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/vm_service-9.4.0", + "packageUri": "lib/", + "languageVersion": "2.15" + }, + { + "name": "watcher", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/watcher-1.1.3", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "web", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/web-0.5.1", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "web_socket_channel", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.5", + "packageUri": "lib/", + "languageVersion": "3.3" + }, + { + "name": "webkit_inspection_protocol", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.1", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "yaml", + "rootUri": "file:///Users/ammaryasir/.pub-cache/hosted/pub.dev/yaml-3.1.3", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "openapi", + "rootUri": "../", + "packageUri": "lib/", + "languageVersion": "2.12" + } + ], + "generated": "2025-09-13T09:53:56.032528Z", + "generator": "pub", + "generatorVersion": "3.7.2", + "flutterRoot": "file:///Users/ammaryasir/development/flutter", + "flutterVersion": "3.29.2", + "pubCache": "file:///Users/ammaryasir/.pub-cache" +} diff --git a/pub/bin/test/test.dart-3.7.2.snapshot b/pub/bin/test/test.dart-3.7.2.snapshot new file mode 100644 index 0000000..4d99291 Binary files /dev/null and b/pub/bin/test/test.dart-3.7.2.snapshot differ diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..f90d9db --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,17 @@ +# +# AUTO-GENERATED FILE, DO NOT MODIFY! +# + +name: 'openapi' +version: '1.0.0' +description: 'Banxa OpenAPI API client' +homepage: 'http://github.com/GeniusVentures/banxa' +environment: + sdk: '>=2.12.0 <4.0.0' +dependencies: + collection: '>=1.17.0 <2.0.0' + http: '>=0.13.0 <2.0.0' + intl: any + meta: '>=1.1.8 <2.0.0' +dev_dependencies: + test: '>=1.21.6 <1.22.0' diff --git a/test/address_test.dart b/test/address_test.dart new file mode 100644 index 0000000..e9c3503 --- /dev/null +++ b/test/address_test.dart @@ -0,0 +1,52 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Address +void main() { + // final instance = Address(); + + group('test Address', () { + // String street1 + test('to test the property `street1`', () async { + // TODO + }); + + // String street2 + test('to test the property `street2`', () async { + // TODO + }); + + // String suburbCity + test('to test the property `suburbCity`', () async { + // TODO + }); + + // String stateProvince + test('to test the property `stateProvince`', () async { + // TODO + }); + + // String postCodeZip + test('to test the property `postCodeZip`', () async { + // TODO + }); + + // String countryCode + test('to test the property `countryCode`', () async { + // TODO + }); + + + }); + +} diff --git a/test/api_error_response_test.dart b/test/api_error_response_test.dart new file mode 100644 index 0000000..c7a0150 --- /dev/null +++ b/test/api_error_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiErrorResponse +void main() { + // final instance = ApiErrorResponse(); + + group('test ApiErrorResponse', () { + // List errors (default value: const []) + test('to test the property `errors`', () async { + // TODO + }); + + + }); + +} diff --git a/test/api_error_source_test.dart b/test/api_error_source_test.dart new file mode 100644 index 0000000..a23a892 --- /dev/null +++ b/test/api_error_source_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiErrorSource +void main() { + // final instance = ApiErrorSource(); + + group('test ApiErrorSource', () { + // A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. \"/data\" for a primary data object, or \"/data/attributes/title\" for a specific attribute]. + // String pointer + test('to test the property `pointer`', () async { + // TODO + }); + + // A string indicating which URI query parameter caused the error. + // String parameter + test('to test the property `parameter`', () async { + // TODO + }); + + + }); + +} diff --git a/test/api_error_test.dart b/test/api_error_test.dart new file mode 100644 index 0000000..968e1ef --- /dev/null +++ b/test/api_error_test.dart @@ -0,0 +1,51 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiError +void main() { + // final instance = ApiError(); + + group('test ApiError', () { + // The HTTP status code applicable to this problem, expressed as a string value. + // String status + test('to test the property `status`', () async { + // TODO + }); + + // A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization. + // String title + test('to test the property `title`', () async { + // TODO + }); + + // A human-readable explanation specific to this occurrence of the problem. + // String detail + test('to test the property `detail`', () async { + // TODO + }); + + // A Banxa-specific error code. + // String code + test('to test the property `code`', () async { + // TODO + }); + + // ApiErrorSource source_ + test('to test the property `source_`', () async { + // TODO + }); + + + }); + +} diff --git a/test/blockchain_test.dart b/test/blockchain_test.dart new file mode 100644 index 0000000..fc0c5f7 --- /dev/null +++ b/test/blockchain_test.dart @@ -0,0 +1,58 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Blockchain +void main() { + // final instance = Blockchain(); + + group('test Blockchain', () { + // String code + test('to test the property `code`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // bool isDefault + test('to test the property `isDefault`', () async { + // TODO + }); + + // String withdrawalFee + test('to test the property `withdrawalFee`', () async { + // TODO + }); + + // String depositFee + test('to test the property `depositFee`', () async { + // TODO + }); + + // String minWithdrawal + test('to test the property `minWithdrawal`', () async { + // TODO + }); + + // Type of blockchain (e.g. MAINNET) + // String type + test('to test the property `type`', () async { + // TODO + }); + + + }); + +} diff --git a/test/coin_test.dart b/test/coin_test.dart new file mode 100644 index 0000000..a759527 --- /dev/null +++ b/test/coin_test.dart @@ -0,0 +1,45 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Coin +void main() { + // final instance = Coin(); + + group('test Coin', () { + // The unique code for the coin. + // String coinCode + test('to test the property `coinCode`', () async { + // TODO + }); + + // The name of the coin. + // String coinName + test('to test the property `coinName`', () async { + // TODO + }); + + // Status of the coin. + // String status + test('to test the property `status`', () async { + // TODO + }); + + // List blockchains (default value: const []) + test('to test the property `blockchains`', () async { + // TODO + }); + + + }); + +} diff --git a/test/coins_api_test.dart b/test/coins_api_test.dart new file mode 100644 index 0000000..9fda057 --- /dev/null +++ b/test/coins_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for CoinsApi +void main() { + // final instance = CoinsApi(); + + group('tests for CoinsApi', () { + // Retrieve a list of Crypto Currencies + // + // Fetches a paginated list of all supported crypto currencies and their blockchain details. + // + //Future getCoins(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int page, int perPage }) async + test('test getCoins', () async { + // TODO + }); + + }); +} diff --git a/test/confirm_sell_order_data_test.dart b/test/confirm_sell_order_data_test.dart new file mode 100644 index 0000000..0998779 --- /dev/null +++ b/test/confirm_sell_order_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConfirmSellOrderData +void main() { + // final instance = ConfirmSellOrderData(); + + group('test ConfirmSellOrderData', () { + // Order order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/test/confirm_sell_order_request_test.dart b/test/confirm_sell_order_request_test.dart new file mode 100644 index 0000000..fceed75 --- /dev/null +++ b/test/confirm_sell_order_request_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConfirmSellOrderRequest +void main() { + // final instance = ConfirmSellOrderRequest(); + + group('test ConfirmSellOrderRequest', () { + // The transaction hash (ID) of the crypto deposit made by the user. + // String transactionHash + test('to test the property `transactionHash`', () async { + // TODO + }); + + // Source of the transaction information (e.g., BLOCKCHAIN_EXPLORER, USER_INPUT). + // String source_ + test('to test the property `source_`', () async { + // TODO + }); + + // The user's wallet address from which the crypto was sent. + // String sourceAddress + test('to test the property `sourceAddress`', () async { + // TODO + }); + + // Tag or memo for the source wallet address, if applicable. + // String sourceAddressTag + test('to test the property `sourceAddressTag`', () async { + // TODO + }); + + + }); + +} diff --git a/test/confirm_sell_order_response_test.dart b/test/confirm_sell_order_response_test.dart new file mode 100644 index 0000000..5282c0d --- /dev/null +++ b/test/confirm_sell_order_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ConfirmSellOrderResponse +void main() { + // final instance = ConfirmSellOrderResponse(); + + group('test ConfirmSellOrderResponse', () { + // ConfirmSellOrderData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/countries_api_test.dart b/test/countries_api_test.dart new file mode 100644 index 0000000..45246b6 --- /dev/null +++ b/test/countries_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for CountriesApi +void main() { + // final instance = CountriesApi(); + + group('tests for CountriesApi', () { + // Retrieve a list of Countries + // + // Fetches a paginated list of supported countries. + // + //Future getCountries(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int page, int perPage }) async + test('test getCountries', () async { + // TODO + }); + + }); +} diff --git a/test/country_test.dart b/test/country_test.dart new file mode 100644 index 0000000..9b3cf42 --- /dev/null +++ b/test/country_test.dart @@ -0,0 +1,50 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Country +void main() { + // final instance = Country(); + + group('test Country', () { + // ISO 3166-1 alpha-2 country code. + // String countryCode + test('to test the property `countryCode`', () async { + // TODO + }); + + // Name of the country. + // String countryName + test('to test the property `countryName`', () async { + // TODO + }); + + // Status. + // String status + test('to test the property `status`', () async { + // TODO + }); + + // bool isStateRequired + test('to test the property `isStateRequired`', () async { + // TODO + }); + + // List supportedDocuments (default value: const []) + test('to test the property `supportedDocuments`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_kyc_account_data_test.dart b/test/create_kyc_account_data_test.dart new file mode 100644 index 0000000..375ccf4 --- /dev/null +++ b/test/create_kyc_account_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateKycAccountData +void main() { + // final instance = CreateKycAccountData(); + + group('test CreateKycAccountData', () { + // KycAccount kycAccount + test('to test the property `kycAccount`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_kyc_account_request_test.dart b/test/create_kyc_account_request_test.dart new file mode 100644 index 0000000..86df792 --- /dev/null +++ b/test/create_kyc_account_request_test.dart @@ -0,0 +1,88 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateKycAccountRequest +void main() { + // final instance = CreateKycAccountRequest(); + + group('test CreateKycAccountRequest', () { + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // String givenName + test('to test the property `givenName`', () async { + // TODO + }); + + // String middleName + test('to test the property `middleName`', () async { + // TODO + }); + + // String surname + test('to test the property `surname`', () async { + // TODO + }); + + // DateTime dob + test('to test the property `dob`', () async { + // TODO + }); + + // String email + test('to test the property `email`', () async { + // TODO + }); + + // String mobileNumber + test('to test the property `mobileNumber`', () async { + // TODO + }); + + // Address residentialAddress + test('to test the property `residentialAddress`', () async { + // TODO + }); + + // String documentType + test('to test the property `documentType`', () async { + // TODO + }); + + // String documentIdNumber + test('to test the property `documentIdNumber`', () async { + // TODO + }); + + // String documentCountryOfIssue + test('to test the property `documentCountryOfIssue`', () async { + // TODO + }); + + // List documentImages (default value: const []) + test('to test the property `documentImages`', () async { + // TODO + }); + + // Arbitrary key-value pairs for additional metadata. + // Map metaData (default value: const {}) + test('to test the property `metaData`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_kyc_account_response_test.dart b/test/create_kyc_account_response_test.dart new file mode 100644 index 0000000..9826191 --- /dev/null +++ b/test/create_kyc_account_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateKycAccountResponse +void main() { + // final instance = CreateKycAccountResponse(); + + group('test CreateKycAccountResponse', () { + // CreateKycAccountData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_nft_order_data_test.dart b/test/create_nft_order_data_test.dart new file mode 100644 index 0000000..8f97aa4 --- /dev/null +++ b/test/create_nft_order_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateNftOrderData +void main() { + // final instance = CreateNftOrderData(); + + group('test CreateNftOrderData', () { + // Order order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_nft_order_request_test.dart b/test/create_nft_order_request_test.dart new file mode 100644 index 0000000..090fd97 --- /dev/null +++ b/test/create_nft_order_request_test.dart @@ -0,0 +1,73 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateNftOrderRequest +void main() { + // final instance = CreateNftOrderRequest(); + + group('test CreateNftOrderRequest', () { + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // String targetWalletAddress + test('to test the property `targetWalletAddress`', () async { + // TODO + }); + + // String targetBlockchain + test('to test the property `targetBlockchain`', () async { + // TODO + }); + + // int paymentMethodId + test('to test the property `paymentMethodId`', () async { + // TODO + }); + + // List nfts (default value: const []) + test('to test the property `nfts`', () async { + // TODO + }); + + // String returnUrlOnSuccess + test('to test the property `returnUrlOnSuccess`', () async { + // TODO + }); + + // String returnUrlOnFailure + test('to test the property `returnUrlOnFailure`', () async { + // TODO + }); + + // String returnUrlOnPending + test('to test the property `returnUrlOnPending`', () async { + // TODO + }); + + // String iframeReferralDomain + test('to test the property `iframeReferralDomain`', () async { + // TODO + }); + + // Arbitrary key-value pairs for additional metadata. + // Map metaData (default value: const {}) + test('to test the property `metaData`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_nft_order_response_test.dart b/test/create_nft_order_response_test.dart new file mode 100644 index 0000000..117a7ba --- /dev/null +++ b/test/create_nft_order_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateNftOrderResponse +void main() { + // final instance = CreateNftOrderResponse(); + + group('test CreateNftOrderResponse', () { + // CreateNftOrderData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_order_data_test.dart b/test/create_order_data_test.dart new file mode 100644 index 0000000..c336de4 --- /dev/null +++ b/test/create_order_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateOrderData +void main() { + // final instance = CreateOrderData(); + + group('test CreateOrderData', () { + // Order order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_order_request_test.dart b/test/create_order_request_test.dart new file mode 100644 index 0000000..f00a513 --- /dev/null +++ b/test/create_order_request_test.dart @@ -0,0 +1,106 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateOrderRequest +void main() { + // final instance = CreateOrderRequest(); + + group('test CreateOrderRequest', () { + // Your internal reference for the user/account. + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // Fiat currency code for the order. For BUY, this is source. For SELL, this is target. + // String fiatCurrency + test('to test the property `fiatCurrency`', () async { + // TODO + }); + + // Coin currency code for the order. For BUY, this is target. For SELL, this is source. + // String coinCurrency + test('to test the property `coinCurrency`', () async { + // TODO + }); + + // Amount of coin to buy/sell. Provide either this or fiat_amount. + // String coinAmount + test('to test the property `coinAmount`', () async { + // TODO + }); + + // Amount of fiat to spend/receive. Provide either this or coin_amount. + // String fiatAmount + test('to test the property `fiatAmount`', () async { + // TODO + }); + + // ID of the chosen payment method. + // int paymentMethodId + test('to test the property `paymentMethodId`', () async { + // TODO + }); + + // User's crypto wallet address (for BUY orders). + // String walletAddress + test('to test the property `walletAddress`', () async { + // TODO + }); + + // Tag or memo for certain wallet addresses (e.g., XRP, XLM). + // String walletAddressTag + test('to test the property `walletAddressTag`', () async { + // TODO + }); + + // URL to redirect the user to on successful payment/order. + // String returnUrlOnSuccess + test('to test the property `returnUrlOnSuccess`', () async { + // TODO + }); + + // URL to redirect the user to on failed payment/order. + // String returnUrlOnFailure + test('to test the property `returnUrlOnFailure`', () async { + // TODO + }); + + // URL to redirect the user to if payment is pending. + // String returnUrlOnPending + test('to test the property `returnUrlOnPending`', () async { + // TODO + }); + + // If using Banxa checkout in an iframe, your domain. + // String iframeReferralDomain + test('to test the property `iframeReferralDomain`', () async { + // TODO + }); + + // Specify blockchain for the coin if applicable. + // String blockchain + test('to test the property `blockchain`', () async { + // TODO + }); + + // Optional ID of a previously created quote to use for this order. + // String quoteId + test('to test the property `quoteId`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_order_response_test.dart b/test/create_order_response_test.dart new file mode 100644 index 0000000..cbb31a6 --- /dev/null +++ b/test/create_order_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateOrderResponse +void main() { + // final instance = CreateOrderResponse(); + + group('test CreateOrderResponse', () { + // CreateOrderData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_quote_data_test.dart b/test/create_quote_data_test.dart new file mode 100644 index 0000000..0eabefc --- /dev/null +++ b/test/create_quote_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateQuoteData +void main() { + // final instance = CreateQuoteData(); + + group('test CreateQuoteData', () { + // Quote quote + test('to test the property `quote`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_quote_request_test.dart b/test/create_quote_request_test.dart new file mode 100644 index 0000000..b117e48 --- /dev/null +++ b/test/create_quote_request_test.dart @@ -0,0 +1,64 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateQuoteRequest +void main() { + // final instance = CreateQuoteRequest(); + + group('test CreateQuoteRequest', () { + // The currency code to convert from (e.g., USD, BTC). + // String sourceCurrency + test('to test the property `sourceCurrency`', () async { + // TODO + }); + + // The currency code to convert to (e.g., BTC, USD). + // String targetCurrency + test('to test the property `targetCurrency`', () async { + // TODO + }); + + // Amount of source currency. Either source_amount or target_amount is required. + // String sourceAmount + test('to test the property `sourceAmount`', () async { + // TODO + }); + + // Amount of target currency. Either source_amount or target_amount is required. + // String targetAmount + test('to test the property `targetAmount`', () async { + // TODO + }); + + // Your internal reference for the user/account. + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // Optional payment method ID to get a quote specific to it. + // int paymentMethodId + test('to test the property `paymentMethodId`', () async { + // TODO + }); + + // Specify blockchain for the target crypto if applicable. + // String blockchain + test('to test the property `blockchain`', () async { + // TODO + }); + + + }); + +} diff --git a/test/create_quote_response_test.dart b/test/create_quote_response_test.dart new file mode 100644 index 0000000..92421fb --- /dev/null +++ b/test/create_quote_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for CreateQuoteResponse +void main() { + // final instance = CreateQuoteResponse(); + + group('test CreateQuoteResponse', () { + // CreateQuoteData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/default_api_test.dart b/test/default_api_test.dart new file mode 100644 index 0000000..e69de29 diff --git a/test/fiat_test.dart b/test/fiat_test.dart new file mode 100644 index 0000000..a243f38 --- /dev/null +++ b/test/fiat_test.dart @@ -0,0 +1,46 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Fiat +void main() { + // final instance = Fiat(); + + group('test Fiat', () { + // The unique code for the fiat currency. + // String fiatCode + test('to test the property `fiatCode`', () async { + // TODO + }); + + // The name of the fiat currency. + // String fiatName + test('to test the property `fiatName`', () async { + // TODO + }); + + // The symbol for the fiat currency. + // String fiatSymbol + test('to test the property `fiatSymbol`', () async { + // TODO + }); + + // Status of the fiat currency. + // String status + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/test/fiats_api_test.dart b/test/fiats_api_test.dart new file mode 100644 index 0000000..443a7e0 --- /dev/null +++ b/test/fiats_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for FiatsApi +void main() { + // final instance = FiatsApi(); + + group('tests for FiatsApi', () { + // Retrieve a list of Fiat Currencies + // + // Fetches a paginated list of all supported fiat currencies, filterable by order type (BUY or SELL). + // + //Future getFiats(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderType, { int page, int perPage }) async + test('test getFiats', () async { + // TODO + }); + + }); +} diff --git a/test/get_coins_data_test.dart b/test/get_coins_data_test.dart new file mode 100644 index 0000000..b8ec84b --- /dev/null +++ b/test/get_coins_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetCoinsData +void main() { + // final instance = GetCoinsData(); + + group('test GetCoinsData', () { + // List coins (default value: const []) + test('to test the property `coins`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_coins_response_test.dart b/test/get_coins_response_test.dart new file mode 100644 index 0000000..4d27b78 --- /dev/null +++ b/test/get_coins_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetCoinsResponse +void main() { + // final instance = GetCoinsResponse(); + + group('test GetCoinsResponse', () { + // Pagination pagination + test('to test the property `pagination`', () async { + // TODO + }); + + // GetCoinsData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_countries_data_test.dart b/test/get_countries_data_test.dart new file mode 100644 index 0000000..d4bd27c --- /dev/null +++ b/test/get_countries_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetCountriesData +void main() { + // final instance = GetCountriesData(); + + group('test GetCountriesData', () { + // List countries (default value: const []) + test('to test the property `countries`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_countries_response_test.dart b/test/get_countries_response_test.dart new file mode 100644 index 0000000..7995488 --- /dev/null +++ b/test/get_countries_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetCountriesResponse +void main() { + // final instance = GetCountriesResponse(); + + group('test GetCountriesResponse', () { + // Pagination pagination + test('to test the property `pagination`', () async { + // TODO + }); + + // GetCountriesData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_fiats_data_test.dart b/test/get_fiats_data_test.dart new file mode 100644 index 0000000..fae05e0 --- /dev/null +++ b/test/get_fiats_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetFiatsData +void main() { + // final instance = GetFiatsData(); + + group('test GetFiatsData', () { + // List fiats (default value: const []) + test('to test the property `fiats`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_fiats_response_test.dart b/test/get_fiats_response_test.dart new file mode 100644 index 0000000..6e786f2 --- /dev/null +++ b/test/get_fiats_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetFiatsResponse +void main() { + // final instance = GetFiatsResponse(); + + group('test GetFiatsResponse', () { + // Pagination pagination + test('to test the property `pagination`', () async { + // TODO + }); + + // GetFiatsData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_kyc_account_data_test.dart b/test/get_kyc_account_data_test.dart new file mode 100644 index 0000000..d392eb9 --- /dev/null +++ b/test/get_kyc_account_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetKycAccountData +void main() { + // final instance = GetKycAccountData(); + + group('test GetKycAccountData', () { + // KycAccount kycAccount + test('to test the property `kycAccount`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_kyc_account_response_test.dart b/test/get_kyc_account_response_test.dart new file mode 100644 index 0000000..f2ed25b --- /dev/null +++ b/test/get_kyc_account_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetKycAccountResponse +void main() { + // final instance = GetKycAccountResponse(); + + group('test GetKycAccountResponse', () { + // GetKycAccountData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_order_data_test.dart b/test/get_order_data_test.dart new file mode 100644 index 0000000..e29e9e0 --- /dev/null +++ b/test/get_order_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetOrderData +void main() { + // final instance = GetOrderData(); + + group('test GetOrderData', () { + // Order order + test('to test the property `order`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_order_response_test.dart b/test/get_order_response_test.dart new file mode 100644 index 0000000..d364029 --- /dev/null +++ b/test/get_order_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetOrderResponse +void main() { + // final instance = GetOrderResponse(); + + group('test GetOrderResponse', () { + // GetOrderData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_orders_data_test.dart b/test/get_orders_data_test.dart new file mode 100644 index 0000000..23402a2 --- /dev/null +++ b/test/get_orders_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetOrdersData +void main() { + // final instance = GetOrdersData(); + + group('test GetOrdersData', () { + // List orders (default value: const []) + test('to test the property `orders`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_orders_response_test.dart b/test/get_orders_response_test.dart new file mode 100644 index 0000000..370c1ae --- /dev/null +++ b/test/get_orders_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetOrdersResponse +void main() { + // final instance = GetOrdersResponse(); + + group('test GetOrdersResponse', () { + // Pagination pagination + test('to test the property `pagination`', () async { + // TODO + }); + + // GetOrdersData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_payment_methods_data_test.dart b/test/get_payment_methods_data_test.dart new file mode 100644 index 0000000..5abcdc2 --- /dev/null +++ b/test/get_payment_methods_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetPaymentMethodsData +void main() { + // final instance = GetPaymentMethodsData(); + + group('test GetPaymentMethodsData', () { + // List paymentMethods (default value: const []) + test('to test the property `paymentMethods`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_payment_methods_response_test.dart b/test/get_payment_methods_response_test.dart new file mode 100644 index 0000000..2763a58 --- /dev/null +++ b/test/get_payment_methods_response_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetPaymentMethodsResponse +void main() { + // final instance = GetPaymentMethodsResponse(); + + group('test GetPaymentMethodsResponse', () { + // Pagination pagination + test('to test the property `pagination`', () async { + // TODO + }); + + // GetPaymentMethodsData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_prices_data_test.dart b/test/get_prices_data_test.dart new file mode 100644 index 0000000..3a92158 --- /dev/null +++ b/test/get_prices_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetPricesData +void main() { + // final instance = GetPricesData(); + + group('test GetPricesData', () { + // List prices (default value: const []) + test('to test the property `prices`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_prices_response_test.dart b/test/get_prices_response_test.dart new file mode 100644 index 0000000..46622fb --- /dev/null +++ b/test/get_prices_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetPricesResponse +void main() { + // final instance = GetPricesResponse(); + + group('test GetPricesResponse', () { + // GetPricesData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_quote_data_test.dart b/test/get_quote_data_test.dart new file mode 100644 index 0000000..8a839a4 --- /dev/null +++ b/test/get_quote_data_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetQuoteData +void main() { + // final instance = GetQuoteData(); + + group('test GetQuoteData', () { + // Quote quote + test('to test the property `quote`', () async { + // TODO + }); + + + }); + +} diff --git a/test/get_quote_response_test.dart b/test/get_quote_response_test.dart new file mode 100644 index 0000000..4965011 --- /dev/null +++ b/test/get_quote_response_test.dart @@ -0,0 +1,27 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for GetQuoteResponse +void main() { + // final instance = GetQuoteResponse(); + + group('test GetQuoteResponse', () { + // GetQuoteData data + test('to test the property `data`', () async { + // TODO + }); + + + }); + +} diff --git a/test/kyc_account_test.dart b/test/kyc_account_test.dart new file mode 100644 index 0000000..a7461ed --- /dev/null +++ b/test/kyc_account_test.dart @@ -0,0 +1,59 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for KycAccount +void main() { + // final instance = KycAccount(); + + group('test KycAccount', () { + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // String kycApplicationId + test('to test the property `kycApplicationId`', () async { + // TODO + }); + + // Overall KYC status for the account. + // String kycStatus + test('to test the property `kycStatus`', () async { + // TODO + }); + + // URL to redirect the user to for KYC process if action is required. + // String kycUrl + test('to test the property `kycUrl`', () async { + // TODO + }); + + // List kycShares (default value: const []) + test('to test the property `kycShares`', () async { + // TODO + }); + + // DateTime createdAt + test('to test the property `createdAt`', () async { + // TODO + }); + + // DateTime updatedAt + test('to test the property `updatedAt`', () async { + // TODO + }); + + + }); + +} diff --git a/test/kyc_api_test.dart b/test/kyc_api_test.dart new file mode 100644 index 0000000..cdb69da --- /dev/null +++ b/test/kyc_api_test.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for KYCApi +void main() { + // final instance = KYCApi(); + + group('tests for KYCApi', () { + // Create or Update KYC Account + // + // Submits customer KYC information to Banxa for verification. This can create a new KYC application or update an existing one. + // + //Future createKycAccount(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateKycAccountRequest createKycAccountRequest) async + test('test createKycAccount', () async { + // TODO + }); + + // Retrieve KYC Account Details + // + // Fetches KYC status and details for a given account reference. + // + //Future getKycAccount(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String accountReference) async + test('test getKycAccount', () async { + // TODO + }); + + }); +} diff --git a/test/kyc_document_image_test.dart b/test/kyc_document_image_test.dart new file mode 100644 index 0000000..9956716 --- /dev/null +++ b/test/kyc_document_image_test.dart @@ -0,0 +1,40 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for KycDocumentImage +void main() { + // final instance = KycDocumentImage(); + + group('test KycDocumentImage', () { + // URL of the uploaded document image (e.g., pre-signed S3 URL). + // String url + test('to test the property `url`', () async { + // TODO + }); + + // MIME type of the image. + // String contentType + test('to test the property `contentType`', () async { + // TODO + }); + + // Original file name of the image. + // String fileName + test('to test the property `fileName`', () async { + // TODO + }); + + + }); + +} diff --git a/test/kyc_share_test.dart b/test/kyc_share_test.dart new file mode 100644 index 0000000..5186135 --- /dev/null +++ b/test/kyc_share_test.dart @@ -0,0 +1,32 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for KycShare +void main() { + // final instance = KycShare(); + + group('test KycShare', () { + // String partnerName + test('to test the property `partnerName`', () async { + // TODO + }); + + // String status + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/test/nft_checkout_data_test.dart b/test/nft_checkout_data_test.dart new file mode 100644 index 0000000..9d89d3d --- /dev/null +++ b/test/nft_checkout_data_test.dart @@ -0,0 +1,77 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for NftCheckoutData +void main() { + // final instance = NftCheckoutData(); + + group('test NftCheckoutData', () { + // String name + test('to test the property `name`', () async { + // TODO + }); + + // int quantity + test('to test the property `quantity`', () async { + // TODO + }); + + // String imageUrl + test('to test the property `imageUrl`', () async { + // TODO + }); + + // String collectionName + test('to test the property `collectionName`', () async { + // TODO + }); + + // String totalPrice + test('to test the property `totalPrice`', () async { + // TODO + }); + + // String priceCurrency + test('to test the property `priceCurrency`', () async { + // TODO + }); + + // String nftId + test('to test the property `nftId`', () async { + // TODO + }); + + // String collectionId + test('to test the property `collectionId`', () async { + // TODO + }); + + // String description + test('to test the property `description`', () async { + // TODO + }); + + // String contractAddress + test('to test the property `contractAddress`', () async { + // TODO + }); + + // List> attributes (default value: const []) + test('to test the property `attributes`', () async { + // TODO + }); + + + }); + +} diff --git a/test/nft_orders_api_test.dart b/test/nft_orders_api_test.dart new file mode 100644 index 0000000..d9393f7 --- /dev/null +++ b/test/nft_orders_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for NftOrdersApi +void main() { + // final instance = NftOrdersApi(); + + group('tests for NftOrdersApi', () { + // Create an NFT Order + // + // Creates a new order for purchasing NFTs. + // + //Future createNftOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateNftOrderRequest createNftOrderRequest) async + test('test createNftOrder', () async { + // TODO + }); + + }); +} diff --git a/test/order_deposit_address_test.dart b/test/order_deposit_address_test.dart new file mode 100644 index 0000000..2a6e4d0 --- /dev/null +++ b/test/order_deposit_address_test.dart @@ -0,0 +1,37 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for OrderDepositAddress +void main() { + // final instance = OrderDepositAddress(); + + group('test OrderDepositAddress', () { + // String address + test('to test the property `address`', () async { + // TODO + }); + + // String memo + test('to test the property `memo`', () async { + // TODO + }); + + // String uri + test('to test the property `uri`', () async { + // TODO + }); + + + }); + +} diff --git a/test/order_test.dart b/test/order_test.dart new file mode 100644 index 0000000..e49eb71 --- /dev/null +++ b/test/order_test.dart @@ -0,0 +1,123 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + // final instance = Order(); + + group('test Order', () { + // Unique Banxa order ID. + // String id + test('to test the property `id`', () async { + // TODO + }); + + // Your internal reference for the user/account. + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // Type of order. + // String orderType + test('to test the property `orderType`', () async { + // TODO + }); + + // String fiatCurrency + test('to test the property `fiatCurrency`', () async { + // TODO + }); + + // String coinCurrency + test('to test the property `coinCurrency`', () async { + // TODO + }); + + // String fiatAmount + test('to test the property `fiatAmount`', () async { + // TODO + }); + + // String coinAmount + test('to test the property `coinAmount`', () async { + // TODO + }); + + // String walletAddress + test('to test the property `walletAddress`', () async { + // TODO + }); + + // String walletAddressTag + test('to test the property `walletAddressTag`', () async { + // TODO + }); + + // String blockchain + test('to test the property `blockchain`', () async { + // TODO + }); + + // Current status of the order. + // String status + test('to test the property `status`', () async { + // TODO + }); + + // URL for the user to complete payment or KYC. + // String checkoutUrl + test('to test the property `checkoutUrl`', () async { + // TODO + }); + + // OrderDepositAddress depositAddress + test('to test the property `depositAddress`', () async { + // TODO + }); + + // String paymentId + test('to test the property `paymentId`', () async { + // TODO + }); + + // String transactionId + test('to test the property `transactionId`', () async { + // TODO + }); + + // int paymentMethodId + test('to test the property `paymentMethodId`', () async { + // TODO + }); + + // String feeAmount + test('to test the property `feeAmount`', () async { + // TODO + }); + + // String networkFeeAmount + test('to test the property `networkFeeAmount`', () async { + // TODO + }); + + // Timestamp when the order was created. + // DateTime createdAt + test('to test the property `createdAt`', () async { + // TODO + }); + + + }); + +} diff --git a/test/orders_api_test.dart b/test/orders_api_test.dart new file mode 100644 index 0000000..f181dd3 --- /dev/null +++ b/test/orders_api_test.dart @@ -0,0 +1,48 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for OrdersApi +void main() { + // final instance = OrdersApi(); + + group('tests for OrdersApi', () { + // Create an Order + // + // Creates a new order (BUY or SELL). For BUY orders, a checkout_url is typically returned. For SELL orders, deposit_address details are returned. + // + //Future createOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateOrderRequest createOrderRequest) async + test('test createOrder', () async { + // TODO + }); + + // Retrieve an Order + // + // Fetches details of a specific order by its Banxa ID. + // + //Future getOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId) async + test('test getOrder', () async { + // TODO + }); + + // Retrieve a list of Orders + // + // Fetches a paginated list of orders, filterable by date, status, and account reference. + // + //Future getOrders(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int page, int perPage, DateTime startDate, DateTime endDate, String status, String accountReference, String orderId, String orderType }) async + test('test getOrders', () async { + // TODO + }); + + }); +} diff --git a/test/pagination_test.dart b/test/pagination_test.dart new file mode 100644 index 0000000..5cb600b --- /dev/null +++ b/test/pagination_test.dart @@ -0,0 +1,42 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pagination +void main() { + // final instance = Pagination(); + + group('test Pagination', () { + // int currentPage + test('to test the property `currentPage`', () async { + // TODO + }); + + // int recordsPerPage + test('to test the property `recordsPerPage`', () async { + // TODO + }); + + // int totalRecords + test('to test the property `totalRecords`', () async { + // TODO + }); + + // int totalPages + test('to test the property `totalPages`', () async { + // TODO + }); + + + }); + +} diff --git a/test/payment_method_test.dart b/test/payment_method_test.dart new file mode 100644 index 0000000..e442d59 --- /dev/null +++ b/test/payment_method_test.dart @@ -0,0 +1,127 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for PaymentMethod +void main() { + // final instance = PaymentMethod(); + + group('test PaymentMethod', () { + // Unique identifier for the payment method. + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Type of payment method. + // String paymentMethodType + test('to test the property `paymentMethodType`', () async { + // TODO + }); + + // Display name of the payment method. + // String name + test('to test the property `name`', () async { + // TODO + }); + + // Status of the payment method. + // String status + test('to test the property `status`', () async { + // TODO + }); + + // URL of the payment method's logo. + // String logoUrl + test('to test the property `logoUrl`', () async { + // TODO + }); + + // Description of the payment method. + // String description + test('to test the property `description`', () async { + // TODO + }); + + // List transactionFees (default value: const []) + test('to test the property `transactionFees`', () async { + // TODO + }); + + // List of supported fiat currency codes. + // List supportedFiat (default value: const []) + test('to test the property `supportedFiat`', () async { + // TODO + }); + + // List of supported coin codes. + // List supportedCoin (default value: const []) + test('to test the property `supportedCoin`', () async { + // TODO + }); + + // String minAmount + test('to test the property `minAmount`', () async { + // TODO + }); + + // String maxAmount + test('to test the property `maxAmount`', () async { + // TODO + }); + + // bool isCard + test('to test the property `isCard`', () async { + // TODO + }); + + // bool isBankTransfer + test('to test the property `isBankTransfer`', () async { + // TODO + }); + + // bool isWallet + test('to test the property `isWallet`', () async { + // TODO + }); + + // bool isInstantSettlement + test('to test the property `isInstantSettlement`', () async { + // TODO + }); + + // bool isPushPayment + test('to test the property `isPushPayment`', () async { + // TODO + }); + + // bool isPullPayment + test('to test the property `isPullPayment`', () async { + // TODO + }); + + // List of ISO 3166-1 alpha-2 country codes where this payment method is allowed. + // List countriesAllowed (default value: const []) + test('to test the property `countriesAllowed`', () async { + // TODO + }); + + // List of ISO 3166-1 alpha-2 country codes where this payment method is blocked. + // List countriesBlocked (default value: const []) + test('to test the property `countriesBlocked`', () async { + // TODO + }); + + + }); + +} diff --git a/test/payment_methods_api_test.dart b/test/payment_methods_api_test.dart new file mode 100644 index 0000000..b9f26dd --- /dev/null +++ b/test/payment_methods_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PaymentMethodsApi +void main() { + // final instance = PaymentMethodsApi(); + + group('tests for PaymentMethodsApi', () { + // Retrieve a list of Payment Methods + // + // Fetches a paginated list of available payment methods, filterable by currencies and amounts. + // + //Future getPaymentMethods(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, { int page, int perPage, String source_, String target, double sourceAmount, double targetAmount, String paymentMethodType, String blockchain }) async + test('test getPaymentMethods', () async { + // TODO + }); + + }); +} diff --git a/test/price_test.dart b/test/price_test.dart new file mode 100644 index 0000000..8c435b4 --- /dev/null +++ b/test/price_test.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Price +void main() { + // final instance = Price(); + + group('test Price', () { + // ID of the payment method these prices apply to. + // int paymentMethodId + test('to test the property `paymentMethodId`', () async { + // TODO + }); + + // Fee included in the spot price. + // String spotPriceFee + test('to test the property `spotPriceFee`', () async { + // TODO + }); + + // Spot price including fees. + // String spotPriceIncludingFee + test('to test the property `spotPriceIncludingFee`', () async { + // TODO + }); + + // Amount of coin. + // String coinAmount + test('to test the property `coinAmount`', () async { + // TODO + }); + + // Coin code. + // String coinCode + test('to test the property `coinCode`', () async { + // TODO + }); + + // Amount of fiat. + // String fiatAmount + test('to test the property `fiatAmount`', () async { + // TODO + }); + + // Fiat code. + // String fiatCode + test('to test the property `fiatCode`', () async { + // TODO + }); + + // String networkFee + test('to test the property `networkFee`', () async { + // TODO + }); + + // String blockchainFee + test('to test the property `blockchainFee`', () async { + // TODO + }); + + + }); + +} diff --git a/test/prices_api_test.dart b/test/prices_api_test.dart new file mode 100644 index 0000000..00fcdaa --- /dev/null +++ b/test/prices_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PricesApi +void main() { + // final instance = PricesApi(); + + group('tests for PricesApi', () { + // Retrieve Prices + // + // Fetches current indicative prices for currency pairs and amounts. This is not a frozen quote. + // + //Future getPrices(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String source_, String target, { double sourceAmount, double targetAmount, int paymentMethodId, String blockchain }) async + test('test getPrices', () async { + // TODO + }); + + }); +} diff --git a/test/quote_test.dart b/test/quote_test.dart new file mode 100644 index 0000000..085cd92 --- /dev/null +++ b/test/quote_test.dart @@ -0,0 +1,74 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Quote +void main() { + // final instance = Quote(); + + group('test Quote', () { + // Unique identifier for the quote. + // int id + test('to test the property `id`', () async { + // TODO + }); + + // Your internal reference for the user/account. + // String accountReference + test('to test the property `accountReference`', () async { + // TODO + }); + + // Fiat currency code involved in the quote. + // String fiatCurrency + test('to test the property `fiatCurrency`', () async { + // TODO + }); + + // Coin currency code involved in the quote. + // String coinCurrency + test('to test the property `coinCurrency`', () async { + // TODO + }); + + // Amount in fiat currency. + // String fiatAmount + test('to test the property `fiatAmount`', () async { + // TODO + }); + + // Amount in coin currency. + // String coinAmount + test('to test the property `coinAmount`', () async { + // TODO + }); + + // Timestamp when the quote expires. + // DateTime expiresAt + test('to test the property `expiresAt`', () async { + // TODO + }); + + // DateTime createdAt + test('to test the property `createdAt`', () async { + // TODO + }); + + // List prices (default value: const []) + test('to test the property `prices`', () async { + // TODO + }); + + + }); + +} diff --git a/test/quotes_api_test.dart b/test/quotes_api_test.dart new file mode 100644 index 0000000..a886331 --- /dev/null +++ b/test/quotes_api_test.dart @@ -0,0 +1,39 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for QuotesApi +void main() { + // final instance = QuotesApi(); + + group('tests for QuotesApi', () { + // Create a Quote + // + // Creates a new, time-sensitive quote for a currency conversion that can be used to place an order. + // + //Future createQuote(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, CreateQuoteRequest createQuoteRequest) async + test('test createQuote', () async { + // TODO + }); + + // Retrieve a Quote + // + // Fetches details of a specific quote by its ID. + // + //Future getQuote(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String id) async + test('test getQuote', () async { + // TODO + }); + + }); +} diff --git a/test/sell_orders_api_test.dart b/test/sell_orders_api_test.dart new file mode 100644 index 0000000..a9990ba --- /dev/null +++ b/test/sell_orders_api_test.dart @@ -0,0 +1,30 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for SellOrdersApi +void main() { + // final instance = SellOrdersApi(); + + group('tests for SellOrdersApi', () { + // Confirm a Sell Order + // + // Confirms a sell order by providing the transaction hash of the user's crypto deposit. + // + //Future confirmSellOrder(String X_BANXA_SIGNATURE, int X_BANXA_TIMESTAMP, String X_BANXA_NONCE, String orderId, ConfirmSellOrderRequest confirmSellOrderRequest) async + test('test confirmSellOrder', () async { + // TODO + }); + + }); +} diff --git a/test/transaction_fee_test.dart b/test/transaction_fee_test.dart new file mode 100644 index 0000000..456a4e6 --- /dev/null +++ b/test/transaction_fee_test.dart @@ -0,0 +1,34 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for TransactionFee +void main() { + // final instance = TransactionFee(); + + group('test TransactionFee', () { + // Type of fee (e.g., PERCENTAGE, FIXED). + // String type + test('to test the property `type`', () async { + // TODO + }); + + // Fee amount. + // String amount + test('to test the property `amount`', () async { + // TODO + }); + + + }); + +}