Skip to content

multiplier_decimal should be string #404

@jjkoh95

Description

@jjkoh95

Steps to reproduce

Running example listed here:

from binance_common.configuration import ConfigurationRestAPI
from binance_common.constants import DERIVATIVES_TRADING_COIN_FUTURES_REST_API_PROD_URL
from binance_sdk_derivatives_trading_coin_futures.derivatives_trading_coin_futures import DerivativesTradingCoinFutures
from binance_sdk_derivatives_trading_coin_futures.rest_api.models import ExchangeInformationResponse

logging.basicConfig(level=logging.INFO)
configuration = ConfigurationRestAPI(api_key="your-api-key", api_secret="your-api-secret", base_path=DERIVATIVES_TRADING_COIN_FUTURES_REST_API_PROD_URL)

client = DerivativesTradingCoinFutures(config_rest_api=configuration)

try:
    response = client.rest_api.exchange_information()

    data: ExchangeInformationResponse = response.data()
    logging.info(f"exchange_information() response: {data}")
except Exception as e:
    logging.error(f"exchange_information() error: {e}")

Error

I ran into error:

ERROR:root:exchange_information() error: 59 validation errors for ExchangeInformationResponse
symbols.0.filters.5.multiplierDecimal
  Input should be a valid integer [type=int_type, input_value='4', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/int_type

Fix

I have made temporary fix by changing the type - here and it works after that.

Tests:

# install temp fix, and run the same code
uv add "git+ssh://git@github.com/jjkoh95/binance-connector-python#subdirectory=clients/derivatives_trading_coin_futures" --branch fix-multiplier-decimal

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions