Metadata-Version: 2.4
Name: foxbit-group-rest-api
Version: 0.1.2
Summary: Foxbit REST API
Home-page: https://github.com/foxbit-group/foxbit-python-sdk
Author: Foxbit
Author-email: developers@foxbit.com.br
License: MIT
Keywords: OpenAPI,OpenAPI-Generator,Foxbit REST API,foxbit,crypto,exchange
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Typing :: Typed
Requires-Python: >= 3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3<3.0.0,>=2.1.0
Requires-Dist: python-dateutil>=2.8.2
Requires-Dist: pydantic>=2
Requires-Dist: typing-extensions>=4.7.1
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Foxbit Python SDK

This is the official SDK provided by Foxbit for interacting with our APIs using Python.

## Prerequisites

-   Python 3.9 or higher
-   pip

## Installation

Install the SDK using pip:

```bash
pip install foxbit-group-rest-api
```

## How to Use

To start using the SDK, import the desired API module and call its methods:

```python
from foxbit_group.rest_api import ApiClient
from foxbit_group.rest_api.api import MarketDataApi

with ApiClient() as client:
    market_data_api = MarketDataApi(client)

    currencies = market_data_api.list_currencies()
    print("Currencies:", currencies)
```

For public endpoints that don't require authentication, you can use the SDK without any configuration.

## Authentication

For authenticated endpoints, instantiate a `Configuration` object with your API credentials and pass it to `ApiClient`:

```python
from foxbit_group.rest_api import ApiClient, Configuration
from foxbit_group.rest_api.api import TradingApi
from foxbit_group.rest_api.models import CreateOrderRequest, OrderMarket

# Initialize the configuration with your API key and secret
config = Configuration(
    api_key="YOUR_API_KEY",
    api_secret="YOUR_API_SECRET",
)

with ApiClient(config) as client:
    trading_api = TradingApi(client)

    # CreateOrderRequest wraps one of the concrete order types
    # (OrderMarket, OrderLimit, OrderInstant, OrderStop, OrderStopLimit)
    order = trading_api.create_order(
        create_order_request=CreateOrderRequest(
            OrderMarket(
                side="BUY",
                type="MARKET",
                market_symbol="btcbrl",
                quantity="1",
            )
        )
    )
    print("Order created:", order)
```

The SDK will automatically:

1.  Generate the current timestamp
2.  Create the request signature using your API secret (HMAC-SHA256)
3.  Add the required headers to each request:
    -   `X-FB-ACCESS-KEY`: Your API key
    -   `X-FB-ACCESS-TIMESTAMP`: Current timestamp
    -   `X-FB-ACCESS-SIGNATURE`: Signature generated from your API secret

Your `api_secret` is only used locally to sign requests; it is never sent over the wire.

> **Note on retries:** the signature and timestamp are computed once, when the
> request is serialized. If you enable transport-level retries
> (`Configuration(retries=...)`), a retried attempt replays the original
> timestamp and may be rejected as expired. Prefer retrying at the call site
> (call the SDK method again) so each attempt is signed afresh.

## Error Handling

API errors raise typed exceptions, all inheriting from `ApiException`:

```python
from foxbit_group.rest_api import ApiClient, Configuration
from foxbit_group.rest_api.api import TradingApi
from foxbit_group.rest_api.exceptions import ApiException, UnauthorizedException

config = Configuration(api_key="YOUR_API_KEY", api_secret="YOUR_API_SECRET")

with ApiClient(config) as client:
    try:
        orders = TradingApi(client).list_orders()
    except UnauthorizedException:
        print("Invalid credentials or rejected signature")
    except ApiException as e:
        print(f"API error: {e.status} - {e.body}")
```

## Documentation for API Endpoints

You can find detailed documentation for each API endpoint in the [Foxbit API Documentation](https://docs.foxbit.com.br/rest/v3).

Each API class has its own page, with an example per method:


- [AccountApi](docs/AccountApi.md)

- [BanksApi](docs/BanksApi.md)

- [DepositApi](docs/DepositApi.md)

- [MarketDataApi](docs/MarketDataApi.md)

- [MemberInfoApi](docs/MemberInfoApi.md)

- [PrimeDeskApi](docs/PrimeDeskApi.md)

- [SystemApi](docs/SystemApi.md)

- [TradingApi](docs/TradingApi.md)

- [TransactionalLimitsApi](docs/TransactionalLimitsApi.md)

- [TravelRuleApi](docs/TravelRuleApi.md)

- [WithdrawalApi](docs/WithdrawalApi.md)


## Documentation for Models


- [Account](docs/Account.md)

- [Accounts](docs/Accounts.md)

- [Bank](docs/Bank.md)

- [BankAccount](docs/BankAccount.md)

- [BankAccountData](docs/BankAccountData.md)

- [BankBranch](docs/BankBranch.md)

- [BankData](docs/BankData.md)

- [Banks](docs/Banks.md)

- [BeneficiaryOwnExchangeWallet](docs/BeneficiaryOwnExchangeWallet.md)

- [BeneficiaryOwnPrivateWallet](docs/BeneficiaryOwnPrivateWallet.md)

- [BeneficiaryThirdPartyExchangeWallet](docs/BeneficiaryThirdPartyExchangeWallet.md)

- [BeneficiaryThirdPartyPrivateWallet](docs/BeneficiaryThirdPartyPrivateWallet.md)

- [Best](docs/Best.md)

- [BestSide](docs/BestSide.md)

- [BestSideWithVolume](docs/BestSideWithVolume.md)

- [BestWithVolume](docs/BestWithVolume.md)

- [CancelOrdersRequest](docs/CancelOrdersRequest.md)

- [CandlestickInner](docs/CandlestickInner.md)

- [CreateDepositTravelRuleRequest](docs/CreateDepositTravelRuleRequest.md)

- [CreateOrderRequest](docs/CreateOrderRequest.md)

- [CreateWithdrawalRequest](docs/CreateWithdrawalRequest.md)

- [Currencies](docs/Currencies.md)

- [Currency](docs/Currency.md)

- [CurrencyCategory](docs/CurrencyCategory.md)

- [CurrencyDepositInfo](docs/CurrencyDepositInfo.md)

- [CurrencyNetwork](docs/CurrencyNetwork.md)

- [CurrencyWithdrawInfo](docs/CurrencyWithdrawInfo.md)

- [Deposit](docs/Deposit.md)

- [DepositAddress](docs/DepositAddress.md)

- [DepositTravelRuleResponse](docs/DepositTravelRuleResponse.md)

- [Deposits](docs/Deposits.md)

- [DetailsCrypto](docs/DetailsCrypto.md)

- [DetailsWithdrawCrypto](docs/DetailsWithdrawCrypto.md)

- [DetailsWithdrawCryptoTag](docs/DetailsWithdrawCryptoTag.md)

- [ErrorData](docs/ErrorData.md)

- [ErrorDetails](docs/ErrorDetails.md)

- [ErrorResponse](docs/ErrorResponse.md)

- [ExecuteQuoteCreatedModel](docs/ExecuteQuoteCreatedModel.md)

- [Fees](docs/Fees.md)

- [GetTickerResponse](docs/GetTickerResponse.md)

- [GetTickerWithBestResponse](docs/GetTickerWithBestResponse.md)

- [LastTrade](docs/LastTrade.md)

- [Market](docs/Market.md)

- [MarketCurrency](docs/MarketCurrency.md)

- [MarketModel](docs/MarketModel.md)

- [Markets](docs/Markets.md)

- [MarketsBaseCurrencyModel](docs/MarketsBaseCurrencyModel.md)

- [MarketsQuoteCurrencyModel](docs/MarketsQuoteCurrencyModel.md)

- [MarketsResponseModel](docs/MarketsResponseModel.md)

- [Member](docs/Member.md)

- [Network](docs/Network.md)

- [NetworkDepositInfo](docs/NetworkDepositInfo.md)

- [NetworkWithdrawInfo](docs/NetworkWithdrawInfo.md)

- [OperationReason](docs/OperationReason.md)

- [OperationReasons](docs/OperationReasons.md)

- [Order](docs/Order.md)

- [OrderBatchResponse](docs/OrderBatchResponse.md)

- [OrderBatchResponseError](docs/OrderBatchResponseError.md)

- [OrderBatchResult](docs/OrderBatchResult.md)

- [OrderCancel](docs/OrderCancel.md)

- [OrderCancelReplace](docs/OrderCancelReplace.md)

- [OrderCancelReplaceCancelResult](docs/OrderCancelReplaceCancelResult.md)

- [OrderCancelReplaceCreateResult](docs/OrderCancelReplaceCreateResult.md)

- [OrderCancelReplaceError](docs/OrderCancelReplaceError.md)

- [OrderCanceled](docs/OrderCanceled.md)

- [OrderCanceledReplaced](docs/OrderCanceledReplaced.md)

- [OrderCreateBatchModel](docs/OrderCreateBatchModel.md)

- [OrderCreated](docs/OrderCreated.md)

- [OrderInstant](docs/OrderInstant.md)

- [OrderLimit](docs/OrderLimit.md)

- [OrderMarket](docs/OrderMarket.md)

- [OrderStop](docs/OrderStop.md)

- [OrderStopLimit](docs/OrderStopLimit.md)

- [OrderWithoutRemark](docs/OrderWithoutRemark.md)

- [OrderbookDepth](docs/OrderbookDepth.md)

- [Orders](docs/Orders.md)

- [OrdersCancelAll](docs/OrdersCancelAll.md)

- [OrdersCancelClientOrderId](docs/OrdersCancelClientOrderId.md)

- [OrdersCancelId](docs/OrdersCancelId.md)

- [OrdersCancelMarket](docs/OrdersCancelMarket.md)

- [OrdersCancelMarketSide](docs/OrdersCancelMarketSide.md)

- [OrdersCancelSn](docs/OrdersCancelSn.md)

- [OrdersCanceled](docs/OrdersCanceled.md)

- [OriginatorOwnExchangeWallet](docs/OriginatorOwnExchangeWallet.md)

- [OriginatorOwnPrivateWallet](docs/OriginatorOwnPrivateWallet.md)

- [OriginatorThirdPartyExchangeWallet](docs/OriginatorThirdPartyExchangeWallet.md)

- [OriginatorThirdPartyPrivateWallet](docs/OriginatorThirdPartyPrivateWallet.md)

- [PrimeDeskExecuteQuoteModel](docs/PrimeDeskExecuteQuoteModel.md)

- [PrimeDeskExecutionHistoryData](docs/PrimeDeskExecutionHistoryData.md)

- [PrimeDeskExecutionHistoryModel](docs/PrimeDeskExecutionHistoryModel.md)

- [PublicTrade](docs/PublicTrade.md)

- [PublicTrades](docs/PublicTrades.md)

- [Quote](docs/Quote.md)

- [RequestForQuote](docs/RequestForQuote.md)

- [RequestForQuoteByAmount](docs/RequestForQuoteByAmount.md)

- [RequestForQuoteByQuantity](docs/RequestForQuoteByQuantity.md)

- [RequestForQuoteResponseModel](docs/RequestForQuoteResponseModel.md)

- [Rolling24Hr](docs/Rolling24Hr.md)

- [Sparkline](docs/Sparkline.md)

- [Sparkline400](docs/Sparkline400.md)

- [Sparkline400Error](docs/Sparkline400Error.md)

- [Sparklines](docs/Sparklines.md)

- [SystemTime](docs/SystemTime.md)

- [Ticker](docs/Ticker.md)

- [TickerWithBest](docs/TickerWithBest.md)

- [Trade](docs/Trade.md)

- [Trades](docs/Trades.md)

- [TradingFee](docs/TradingFee.md)

- [TradingFeesResponse](docs/TradingFeesResponse.md)

- [Transaction](docs/Transaction.md)

- [TransactionalLimit](docs/TransactionalLimit.md)

- [TransactionalLimits](docs/TransactionalLimits.md)

- [TransactionalLimitsResponse](docs/TransactionalLimitsResponse.md)

- [TransactionsResponse](docs/TransactionsResponse.md)

- [TravelRuleInfoResponse](docs/TravelRuleInfoResponse.md)

- [UnauthorizedError](docs/UnauthorizedError.md)

- [UnauthorizedErrorResponse](docs/UnauthorizedErrorResponse.md)

- [Withdrawal](docs/Withdrawal.md)

- [WithdrawalCreated](docs/WithdrawalCreated.md)

- [WithdrawalCrypto](docs/WithdrawalCrypto.md)

- [WithdrawalFiat](docs/WithdrawalFiat.md)

- [WithdrawalList](docs/WithdrawalList.md)

- [WithdrawalTravelRule](docs/WithdrawalTravelRule.md)

- [Withdrawals](docs/Withdrawals.md)


## About This SDK

This SDK was automatically generated using [OpenAPI Generator](https://openapi-generator.tech/).

----------

> **Note:** This SDK is actively maintained by the Foxbit team. For more information, visit [https://foxbit.com.br](https://foxbit.com.br).
