Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BatchOrders does not work #29

Open
husmen73 opened this issue Nov 2, 2021 · 2 comments
Open

BatchOrders does not work #29

husmen73 opened this issue Nov 2, 2021 · 2 comments

Comments

@husmen73
Copy link

husmen73 commented Nov 2, 2021

Hi,

postBatchOrders method does not work due guzzle url encode. Is there any options for urlencoding to disable?

Should be

[%7B%22symbol%22:%22BTCUSDT%22,%22side%22:%22BUY%22,%22positionSide%22:%22LONG%22,%22type%22:%22MARKET%22,%22quantity%22:%220.01%22%7D]

But guzzle converting when sending like this

%5B%257B%2522symbol%2522%3A%2522BTCUSDT%2522%2C%2522side%2522%3A%2522BUY%2522%2C%2522positionSide%2522%3A%2522LONG%2522%2C%2522type%2522%3A%2522MARKET%2522%2C%2522quantity%2522%3A%25220.01%2522%257D%5D

@zhouaini528
Copy link
Owner

Thank you for your discovery, I will fix it

@zhouaini528
Copy link
Owner

@husmen73 Hi , I have solved it.

$result=$binance->trade()->postBatchOrders([
        'batchOrders'=>[
            [
                'symbol'=>'BTCUSDT',
                'side'=>'BUY',
                'type'=>'LIMIT',
                'quantity'=>'1',
                'price'=>'60000',
                'timeInForce'=>'GTC',
                //'newClientOrderId'=>'xxxxxxx'
            ],
            [
                'symbol'=>'BTCUSDT',
                'side'=>'BUY',
                'type'=>'LIMIT',
                'quantity'=>'2',
                'price'=>'60000',
                'timeInForce'=>'GTC',
                //'newClientOrderId'=>'xxxxxxx'
            ],
        ]
    ]);

https://github.com/zhouaini528/binance-php/blob/master/tests/future/trade.php#L52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants