Skip to main content

resolve_credentials

Function resolve_credentials 

Source
pub fn resolve_credentials(
    config_api_key: Option<String>,
    config_api_secret: Option<String>,
    environment: BinanceEnvironment,
    product_type: BinanceProductType,
) -> Result<(String, String)>
Expand description

Resolves API credentials from config or environment variables.

Checks standard environment variables:

  • Live: BINANCE_API_KEY / BINANCE_API_SECRET
  • Testnet (Spot): BINANCE_TESTNET_API_KEY / BINANCE_TESTNET_API_SECRET
  • Testnet (Futures): BINANCE_FUTURES_TESTNET_API_KEY / BINANCE_FUTURES_TESTNET_API_SECRET
  • Demo: BINANCE_DEMO_API_KEY / BINANCE_DEMO_API_SECRET

The deprecated *_ED25519_* environment variables are no longer supported. If detected, a clear error is returned with migration instructions.

ยงErrors

Returns an error if credentials cannot be resolved from config or environment.