From 0e8ce09a6c0ca38754912c89d8c79a335b9cc264 Mon Sep 17 00:00:00 2001 From: Jack Latourette Date: Wed, 8 Apr 2026 14:38:55 -0700 Subject: [PATCH] fix: accept string values for gasPrice, baseFee, priorityFee in TransactionFee The Fireblocks API returns gasPrice, baseFee, and priorityFee as strings (e.g. "1", "0.005") in the estimate_transaction_fee response, but the TransactionFee model declares these fields as StrictFloat | StrictInt. Pydantic's StrictFloat/StrictInt reject string inputs without coercion, causing model validation to fail. The SDK then falls back to returning an UnknownBaseModel instead of the expected EstimatedTransactionFeeResponse, breaking downstream attribute access (e.g. response.medium.network_fee). Add StrictStr to the Union type for these three fields so the model validates successfully regardless of whether the API returns numeric or string representations. Co-Authored-By: Claude Opus 4.6 (1M context) --- fireblocks/models/transaction_fee.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fireblocks/models/transaction_fee.py b/fireblocks/models/transaction_fee.py index 967848af..5d033920 100644 --- a/fireblocks/models/transaction_fee.py +++ b/fireblocks/models/transaction_fee.py @@ -28,11 +28,11 @@ class TransactionFee(BaseModel): TransactionFee """ # noqa: E501 fee_per_byte: Optional[StrictStr] = Field(default=None, alias="feePerByte") - gas_price: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="gasPrice") + gas_price: Optional[Union[StrictFloat, StrictInt, StrictStr]] = Field(default=None, alias="gasPrice") gas_limit: Optional[StrictStr] = Field(default=None, alias="gasLimit") network_fee: Optional[StrictStr] = Field(default=None, alias="networkFee") - base_fee: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(optional) Base Fee according to EIP-1559 (ETH assets)", alias="baseFee") - priority_fee: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(optional) Priority Fee according to EIP-1559 (ETH assets)", alias="priorityFee") + base_fee: Optional[Union[StrictFloat, StrictInt, StrictStr]] = Field(default=None, description="(optional) Base Fee according to EIP-1559 (ETH assets)", alias="baseFee") + priority_fee: Optional[Union[StrictFloat, StrictInt, StrictStr]] = Field(default=None, description="(optional) Priority Fee according to EIP-1559 (ETH assets)", alias="priorityFee") max_fee_per_gas_delta: Optional[StrictStr] = Field(default=None, description="Max Fee Per Gas Delta added only for EIP-1559 (ETH assets)", alias="maxFeePerGasDelta") l1_fee: Optional[StrictStr] = Field(default=None, description="Layer 1 fee for Layer 2 chains", alias="l1Fee") __properties: ClassVar[List[str]] = ["feePerByte", "gasPrice", "gasLimit", "networkFee", "baseFee", "priorityFee", "maxFeePerGasDelta", "l1Fee"]