Igosuki/binance-rs-async

Signature for this request in not valid

Closed this issue · 2 comments

let account: Account = Binance::new_with_env(&Config::testnet());
    let limit_buy = OrderRequest {
            symbol: "BTCUSDT".to_string(),
            quantity: Some(0.01),
            price: Some(40000.0),
            order_type: OrderType::Limit,
            side: OrderSide::Buy,
            time_in_force: Some(TimeInForce::FOK),
            ..OrderRequest::default()
        };
    match account.place_order(limit_buy).await {
        Ok(answer) => println!("{:?}", answer),
        Err(e) => println!("Error: {e}"),
    }

This is my code and output is

Error: code: -1022, msg: Signature for this request is not valid.

Hi @yash261, could you please try to initialize account this way?
let account = binance::account::Account::new_with_config(Some(api_key), Some(secret_key), &Config::testnet());
Where api_key and secret_key are Strings. Will be waiting for your response.

It worked. Thanks a lot.