Login
Here is a sample of your problem:
Ethereum API error: Delphi + Binance API + Limited Order Problem
In this article, we will examine why you find an incorrect order error when you use the Ethereum application subscription in the Delphi application. We also discuss possible solutions and provide code examples to solve the problem.
Question
Invalid signature error notice. It happens when your Binance application subscription does not meet the required signature format. This can happen for a number of reasons such as:
- API end point or incorrect method
- Insufficient account balance or access rights
- Missing or incompatible parameters
Code Example
Use this problem to repeat a simple example in Delph. We create a form that displays a button and tries to order a border with the Binance application interface.
`delphinst1.pas
Torm1.button1click procedure (sender: …
originally
// Set the Binance API operating data (API key, secret key)
arm
Mirikey: string;
Apisecret: string;
// platform Binance application subscription item
API: = tbinanepi.create;
API.Setapikey (Mirikey);
API.Setapisecret (Apisecret);
// Get a check account balance
Var balance: integer;
API.GETBALANCE (‘ETH’, ‘USDT’, balance, zero, zero);
// Create a new request
VAR order: TEER;
Order.symbol: = ‘BTC/USDT’;
Order.Side: = Order.buy;
Order.quantity: = 1;
Order.marketprice: = Float64 (1000.00);
Order.Pricingse: = Float64 (10.00); // assumes 10%interest
Order.Sellingfee: = floating64 (20.00); // assumes a 20%interest
// try to make an order
If Api.order (‘Border’, ‘Buy’, Request)
Writeln (‘Order is done with success!’);
other
Writeln (‘order investment error.’);
end;
`
problem
In this example, we will try to place a border purchase order (purchase) in the Bitcoin/USDT pair using the Binance application subscription. We define our application subscription information and receive the current account balance. Then we created a new cheer object with the desired features.
Finally, we tried to place an order using api.order ('border', 'buy', order)
.
Solution
To solve this problem, you need:
- Please check your order
: Make sure the terminal and API method fill the required signature format. The Binance application interface uses a specific signature system for limited orders.
- Check your account balance : Make sure your account has enough funds to place your order.
- Use the correct cardification features
: Check twice the features of the TEER object you are going to “api.order ()”. In particular, make sure the “MarketPrice” field corresponds to the desired price.
Here’s an example of an example with some additional inspections:
`delphinst1.pas
Torm1.button1click procedure (sender: …
originally
// Set the Binance API operating data (API key, secret key)
arm
Mirikey: string;
Apisecret: string;
// platform Binance application subscription item
API: = tbinanepi.create;
API.Setapikey (Mirikey);
API.Setapisecret (Apisecret);
// Get a check account balance
Var balance: integer;
If API.GetBalance (‘ETH’, ‘USDT’, Balance, zero, zero) then
Writeln (‘account balance is valid.’);
other
Writeln (‘Error Account Balance:’, Api.Getbalanceerror);
end;
// Create a new request
VAR order: TEER;
If order.SYMBOL = ‘BTC/USDT’
Order.Side: = Order.buy;
Order.quantity: = 1;
Order.marketprice: = Float64 (1000.00); // assumes the market price of $ 10,000
Order.Pricingse: = Float64 (10.00); // assumes 10%interest
Order.Sellingfee: = floating64 (20.00); // assumes a 20%interest
// try to make an order
If Api.order (‘Border’, ‘Buy’, Request)
Writeln (‘Order is done with success!’);
other
Writeln (‘order investment error:’, api.getbalanceerror);
end;
other
Writeln (‘Invalid symbol:’, order.