Skip to main content

fixedfloat-client

PyPI version License: MIT Python Version

Modern, fully typed Python client library for the FixedFloat cryptocurrency exchange REST API v2.

Official API documentation: https://fixedfloat.com/api


Features

  • ⚡ Fixed & Float Exchange Rates — Choose between guaranteed fixed rates (1% fee) and floating market rates (0.5% fee).
  • 🔐 Automatic Request Signing — Cryptographic HMAC-SHA256 signature generation (X-API-KEY & X-API-SIGN) built-in.
  • 🪙 Multi-Currency Support — Trade Bitcoin, Ethereum, USDT, Solana, Monero, and dozens of other coins across multiple blockchains.
  • 🐍 Modern Pythonic Design — Type annotations, dataclass models (Order, PriceResult, Currency), context manager support (with FixedFloat(...) as client:), and custom exceptions.
  • 🚨 Emergency Handling — Support for emergency resolution actions (EXCHANGE or REFUND) on interrupted orders.

Installation

pip install fixedfloat-client

Requires Python 3.10 or higher.


Quick Start (Safe Check)

The quick check only inspects supported currencies and price quotes. It does not create orders or spend funds:

import os
from fixedfloat import FixedFloat

with FixedFloat(
    api_key=os.environ.get("FIXEDFLOAT_API_KEY"),
    api_secret=os.environ.get("FIXEDFLOAT_API_SECRET"),
) as client:
    # 1. Fetch available currencies
    currencies = client.get_currencies()
    print(f"Available currencies: {len(currencies)}")

    # 2. Query price calculation for 0.1 BTC to ETH
    price = client.get_price(
        from_ccy="BTC",
        to_ccy="ETH",
        amount=0.1,
        direction="from",
        order_type="float",
    )
    print(f"0.1 BTC -> {price.to_side.amount} ETH (Rate: {price.to_side.rate})")

Usage Guide

1. Creating a Floating Rate Order

Create an exchange order with a floating rate, deposit instructions, and receive destination address:

from fixedfloat import FixedFloat, FixedFloatError

with FixedFloat(
    api_key="your_api_key",
    api_secret="your_api_secret",
) as client:
    # Create float order
    order = client.create_order(
        from_ccy="BTC",
        to_ccy="ETH",
        amount=0.1,
        direction="from",
        order_type="float",
        to_address="0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
        refund_address="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",  # optional
    )

    print(f"Order Created! ID: {order.id}")
    print(f"Security Token: {order.token}")
    print(f"Send BTC to: {order.from_side.address}")
    print(f"Order Status: {order.status}")

2. Creating a Fixed Rate Order

Lock in a guaranteed rate for 10 minutes:

fixed_order = client.create_order(
    from_ccy="ETH",
    to_ccy="BTC",
    amount=2.5,
    direction="from",
    order_type="fixed",
    to_address="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
)

print(f"Fixed Order ID: {fixed_order.id}")
print(f"Expected Payout: {fixed_order.to_side.amount} BTC")
print(f"Send ETH to: {fixed_order.from_side.address}")

3. Tracking Order Status & QR Codes

Check order execution, transaction confirmations, and fetch QR codes:

# Query status using order ID and secret token
current = client.get_order(order.id, order.token)
print(f"Status: {current.status}")

if current.from_side.tx:
    print(f"Deposit confirmations: {current.from_side.tx.confirmations}")

# Fetch QR code for deposit address
qr = client.get_qr(order.id, order.token)
print(f"Deposit QR code: {qr.src}")

# Attach email address for status notifications
client.set_email(order.id, order.token, "user@example.com")

4. Setting Emergency Action Choice

If an order requires user decision (e.g. rate shifted or deposit was delayed):

# Choose to execute exchange at current market rate or refund
client.set_emergency(
    id=order.id,
    token=order.token,
    choice="REFUND",
    address="bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
)
print("Emergency action submitted.")

API Reference

FixedFloat Class

Constructor

FixedFloat(
    api_key: Optional[str] = None,
    api_secret: Optional[str] = None,
    base_url: str = "https://ff.io/api/v2",
    timeout: float = 15.0,
)
Parameter Type Default Description
api_key str None Your FixedFloat API key.
api_secret str None Your FixedFloat API secret for HMAC signatures.
base_url str "https://ff.io/api/v2" FixedFloat API v2 base URL.
timeout float 15.0 HTTP request timeout in seconds.

Methods

  • get_currencies() -> list[Currency] — Retrieves all supported cryptocurrencies and networks.
  • get_price(from_ccy, to_ccy, amount, direction="from", order_type="float", ...) -> PriceResult — Price estimates, rates, limits.
  • create_order(from_ccy, to_ccy, amount, to_address, direction="from", order_type="float", ...) -> Order — Creates a new order.
  • get_order(id: str, token: str) -> Order — Retrieves order status and transaction info.
  • set_emergency(id, token, choice, address=None, extra_id=None) -> Any — Sets emergency choice (EXCHANGE or REFUND).
  • set_email(id, token, email) -> Any — Sets email address for order notifications.
  • get_qr(id, token) -> QrResult — Retrieves deposit address QR code.

Error Handling

When the FixedFloat API returns an error or non-zero status code, a FixedFloatError is raised:

from fixedfloat import FixedFloat, FixedFloatError

try:
    with FixedFloat() as client:
        client.get_order("INVALID_ID", "INVALID_TOKEN")
except FixedFloatError as exc:
    print(f"FixedFloat Error: {exc.message} (Code: {exc.code})")

Common error codes:

  • 101 — Invalid currency pair or amount out of limits.
  • 102 — Missing required parameter.
  • 103 — Invalid destination wallet address.
  • 401 — Unauthorized: invalid API key or signature.

License

MIT

Metadata

Release files for fixedfloat-client 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fixedfloat-client 0.1.0
File Size Uploaded Provenance Actions
fixedfloat_client-0.1.0.tar.gz 22.4 kB Without provenance Details for fixedfloat_client-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fixedfloat-client 0.1.0
File Interpreter ABI Platform Actions
fixedfloat_client-0.1.0-py3-none-any.whl Python 3 none any Details for fixedfloat_client-0.1.0-py3-none-any.whl

Total release size: 31.7 kB

Release files / fixedfloat_client-0.1.0.tar.gz

Download URL fixedfloat_client-0.1.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6235a47e67dc7ea49bed5dca144d0cea12888c794ac683f4360c77705bef6a2c
BLAKE2b-256 checksum
How to use checksums
6c89fd6bcc7587a77ab21fdbdafed462794362ab00e1793f22903502fd69151f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fixedfloat_client-0.1.0-py3-none-any.whl

Download URL fixedfloat_client-0.1.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3463b81d94e2c7b5b5ad23a12765386f7651bd4ac95f3025107eb084b2c3c11e
BLAKE2b-256 checksum
How to use checksums
d91645a95c8b5845ca2531a4b833de121a7b394eaf5ade323e860d89a92e8d9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fixedfloat-client 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page