Add optional UTXOs parameter
Scenario:
When dxMakePartialOrder or dxMakeOrder are called, there is currently no way to control where funds come from in the order and there is no way to prevent XBridge from autosplitting UTXOs on calls to dxMakePartialOrder.
The use_all_funds param is being added to allow for proper segregation and accounting of funds within a wallet, which in turn allows a trading bot to trade multiple pairs more conveniently.
To do:
- [x] Add optional
use_all_fundsparameter todxMakePartialOrder -
true(default) - dxMakePartialOrder uses funds from all available addresses -
false- dxMakePartialOrder will try to use funds only from the address specified by the maker_address parameter.
- [x] Add optional use_all_funds parameter to
dxMakeOrder -
true(default) -dxMakeOrderuses funds from all available addresses -
false-dxMakeOrderwill try to use funds only from the address specified by themaker_addressparameter.
- [x] When a partial or exact order is created and
use_all_funds = false, XBridge needs to check if there are sufficient funds in the address as follows: - if
use_all_fundsoption = false, when an order is created by callingdxMakePartialOrderordxMakeOrderandXBridge verifies there are not enough funds available inmaker_addressto make the order, then return the errorinsufficient_funds
- [x] add optional
auto_splitparameter todxMakePartialOrder - true (default) - funds are split into multiple UTXOs if needed before a partial order is placed
- false - funds are not split into multiple UTXOs before a partial order is placed.
Important: no error log is needed when this parameter is set to false, and setting this parameter to false should not affect whether or not the order is successfully placed.
Goal: Prevent paying extra fees and incurring delays due to autosplitting UTXOs when using trade bots.
Ref: https://api.blocknet.co/#dxmakepartialorder
Test builds: https://gitlab.com/blocknetdx/blocknet/-/pipelines/334555871