fireblocks / fireblocks-sdk-py

Official Python SDK for Fireblocks API
http://docs.fireblocks.com/api/swagger-ui/
MIT License
51 stars 40 forks source link

Error "maxGasPrice must be string" on set_gas_station_configuration #145

Open denistom opened 9 months ago

denistom commented 9 months ago

In the function set_gas_station_configuration parameter maxGasPrice is optional, however it is always added to body

        body = {
            "gasThreshold": gas_threshold,
            "gasCap": gas_cap,
            "maxGasPrice": max_gas_price,
        }

https://github.com/fireblocks/fireblocks-sdk-py/blob/39fb0790f9a79922dc70e4e292d4530a74b89d8e/fireblocks_sdk/sdk.py#L1947

Calling function without max_gas_price is rejected with error "maxGasPrice must be string".

This change of code resolved issue for me:

        body = {
            "gasThreshold": gas_threshold,
            "gasCap": gas_cap #,
#optional            "maxGasPrice": max_gas_price,
        }
        if max_gas_price:
           body["maxGasPrice"]=max_gas_price

Denis